TerminalModeController
Mode-control contract for the terminal buffer.
These toggles affect how subsequent cursor motion and printable writes behave. They do not expose the underlying storage model to the parser.
Inheritors
Functions
Applies borrowed OSC 21 color operations in order, without retaining request. Queries observe preceding operations and share one response in request order. Resets restore the latest theme; dynamic selection and cursor roles retain their dynamic behavior until changed or reset. Application changes do not emit color-scheme notifications.
Switches to the alternate screen buffer with cursor save (CSI ? 1049 h).
Switches to the alternate screen buffer without saving the primary cursor state.
Returns to the primary screen buffer with cursor restore (CSI ? 1049 l).
Returns to the primary screen buffer without restoring a saved cursor.
Restores and removes the most recently saved colors; an empty stack has no effect. The latest host theme remains the source for color resets. Host light/dark preference and bold-as-bright behavior are preserved. An effective change invalidates visible rows without emitting a color-scheme notification; unchanged colors preserve palette identity and render generations.
Saves effective indexed and named colors, including dynamic presentation, on a terminal-wide stack of ten entries. A full stack discards its oldest entry. Screen switches, resize, and theme changes preserve saved colors; hard and soft terminal resets clear the stack. Saving does not repaint.
Pushes the current Kitty keyboard progressive-enhancement flags to the stack, and sets the new active flags. Each screen retains at most 32 entries, evicting the oldest when full.
Restores the configured default shape and enables cursor blinking.
Restores one dynamic color from the latest host-configured theme. Other application overrides are preserved; unsupported targets are ignored.
Restores one format resource to 0; unknown resources are ignored.
Restores all xterm format resources atomically, preserving modifier resources.
Restores one modifier resource's initial value; unknown resources are ignored.
Restores all xterm modifier resources atomically, preserving format resources.
Restores indexed colors from the latest host-configured theme in one update.
Sets alternate-screen wheel scrolling (DEC private mode 1007). Enabled by default; host policy may suppress wheel-to-key translation. Preserves pending wrap and survives screen switches, resize, and DECSTR.
Toggles application cursor key mode (DECCKM, CSI ? 1 h / CSI ? 1 l).
Toggles application keypad mode (DECNKM).
Enables or disables DECAWM auto-wrap (CSI ? 7 h / CSI ? 7 l).
Selects the Backspace wire byte through DECBKM (CSI ? 67 h/l).
Toggles urgent bell mode (?1042).
Enables or disables bracketed paste reporting (CSI ? 2004 h / CSI ? 2004 l).
Subscribes to host color-scheme changes (DECSET/DECRST ?2031).
Toggles cursor blink presentation state.
Sets the cursor shape/style.
Toggles cursor visibility presentation state (DECTCEM, CSI ? 25 h / CSI ? 25 l).
Sets the default cursor shape/style restored on reset.
Updates a dynamic target color (foreground, background, or cursor color).
Enables or disables focus in/out reporting (CSI ? 1004 h / CSI ? 1004 l).
Sets the format-other-keys wire format used when modify-other-keys applies.
Subscribes to text-area resize reports (DECSET/DECRST ?2048).
Enables or disables Insert Replace Mode (IRM, CSI 4 h / CSI 4 l).
Selects format 0 (CSI 27) or 1 (CSI u) for one xterm resource. Resource 0 is independent storage, as in xterm; it does not override per-class formats.
Sets one xterm modifier resource. Resource 0 retains the legacy-profile admission mask; the current PC profile always permits modifiers. Values are -1 (disable), 0..3 for ordinary keys, 0..15 for resource 0, and 0..4 for other key classes.
Sets active Kitty keyboard progressive-enhancement flags.
Enables or disables left/right margin mode (DECLRMM, CSI ? 69 h / CSI ? 69 l).
Sets the modify-other-keys reporting level.
Sets the active mouse report encoding mode used by terminal-to-host reporting.
Sets the active mouse tracking mode used by terminal-to-host reporting.
Enables or disables New Line Mode (LNM, CSI 20 h / CSI 20 l).
Enables or disables Origin Mode (DECOM, CSI ? 6 h / CSI ? 6 l).
Updates an individual color index in the active 256-color palette.
Toggles pop on bell mode (?1043).
Toggles reverse-video presentation state (DECSCNM, CSI ? 5 h / CSI ? 5 l).
Enables reverse wrap across soft-wrapped rows (DEC private mode 45). Requires auto-wrap. Stops at hard line breaks and the top margin. Changing this mode preserves the cursor and pending wrap.
Enables extended reverse wrap (DEC private mode 1045). Requires auto-wrap and takes precedence over mode 45. Crosses hard line breaks and cycles from the top margin to the bottom margin. Changing this mode preserves the cursor and pending wrap.
Requests Shift as a mouse reporting modifier (XTSHIFTESCAPE). Disabled by default so Shift restores local interaction. Hosts may deny reporting. Preserves pending wrap and survives screen switches, resize, and DECSTR.
Toggles synchronized output mode (DECSET/DECRST ?2026).
Sets the theme-configured color palette for the terminal session.
Controls how East Asian Ambiguous codepoints are measured for future writes.