Skip to content

Modes

Terminal modes control global terminal behavior: alternate screen buffer, bracketed paste, mouse tracking, focus events, and auto-wrap. Mode support varies significantly across terminals — mouse tracking modes alone have four variants (X10, normal, button, any-event), and not all terminals implement focus reporting or all bracketed paste edge cases. DEC private modes are the terminal's settings panel, controllable via escape sequences. The alternate screen (?1049) is what makes it possible to run vim and then see your shell exactly as you left it. Bracketed paste mode (?2004) was added decades later to solve a real security problem: without it, pasting rm -rf /\n into a terminal would execute it immediately. With bracketed paste, the terminal wraps pasted text in markers so the shell can distinguish typed input from pasted text. It's one of the few escape sequences born directly from a security vulnerability.

30 features in this category

Analysis2026-04-18

The Modes category covers 30 features. Top performers (100%): Ghostty, iTerm2, WezTerm. Common gaps: Mode 2031 color scheme reporting (8 terminals fail), Save/restore cursor (?1048) (4 terminals fail), Origin mode (DECOM) (2 terminals fail).

Terminal Applications

FeatureiTerm2GhosttyVS CodeWarpKittyCursorTerminal.app
Enter alt screen (DECSET 1049)
Exit alt screen (DECRST 1049)
Alt-scroll mouse wheel (?1007)
Alt screen clear-on-enter (?1047)
Save/restore cursor (?1048)
Alt screen legacy (?47)
App cursor keys (DECCKM)
Application keypad (DECKPAM)
Auto-wrap (DECAWM)
Bracketed paste (DECSET 2004)
Mode 2031 color scheme reporting
DECCOLM 80/132 column switch (?3)
DECSCLM — smooth scroll mode???????
DECSSCLS — set scroll speed???????
Focus tracking (DECSET 1004)
Insert/replace mode (IRM)
Left/Right Margins (DECLRMM, Mode 69)
All motion mouse (DECSET 1003)
SGR mouse mode (DECSET 1006)
Mouse tracking (DECSET 1000)
Origin mode (DECOM)
Reverse video (DECSCNM)
Synchronized output (DECSET 2026)
UTF-8 mouse mode (?1005)
Pop color palette (CSI # Q)
XTPOPSGR — pop SGR stack (CSI # })
Push color palette (CSI # P)
XTPUSHSGR — push SGR stack (CSI # {)
XTRESTORE — restore DEC private modes (CSI ? Pm r)
XTSAVE — save DEC private modes (CSI ? Pm s)

Headless Backends

Parser correctness tested via Termless. A means the parser accepts the sequence, not that it renders correctly.