{"version":"2.1.282","anchor":"terminal-renderer-defers-mode-switch-escape-sequences-into-t","canonical_anchor":"terminal-renderer-defers-mode-switch-escape-sequences-into-t","heading":"Terminal screen-mode switches are now written together with the next frame","tier":"internal","area":"Terminal UI","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.282\/e\/terminal-renderer-defers-mode-switch-escape-sequences-into-t","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.282","markdown":"### Terminal screen-mode switches are now written together with the next frame\n\nFullscreen, mouse and surface mode switches are held and written with the next drawn frame, and flushed when leaving fullscreen\n\n**Unclear.** Whether this visibly reduces flicker or tearing in fullscreen views has not been confirmed.\n\n**What**\n\nThe part of Claude Code that draws the terminal screen can now hold the control codes that switch the alternate screen (the full-window view used by fullscreen interfaces), mouse mode and surface mode, and write them together with the next frame instead of sending them straight away.\n\n- Held codes (`keepForNextFrame`, kept in `keptForNextFrame`) are written with the next frame, on the next tick, or at once when the alternate screen is left.\n\n- Other output written while something is held waits behind it (`writeAfterKept`).\n\n- Leaving the alternate screen always flushes held output first and marks the frame (`leftAltScreenSinceFrame`).\n\n- Switching the alternate screen on or off (`setAltScreenActive`) now also notifies anything tracking mouse hover, right after the switch.\n\nThis applies to everyone and has no switch.\n\n**Why**\n\nIn practice, entering or leaving a fullscreen view now reaches the terminal in the same write as the first frame drawn for it, and other output keeps its order around the switch. If you saw flicker or stale hover highlighting when fullscreen views opened or closed, this is the area that changed.\n\n- Area: Terminal UI\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}