Skip to content

Alt screen legacy (?47)

Category: modes · Baseline: modern · Tags: Xterm Extensions, DEC Private Modes · Specification ↗

CSI ? 47 h/l
DECSET 47 is the original alternate screen buffer mode. The sequence is ESC [ ? 47 h to enter and ESC [ ? 47 l to exit. Unlike the modern ?1049 mode, ?47 does not save or restore the cursor position, and switching back does not clear the alt screen on the next entry. This legacy mode predates the unified ?1049 sequence (which combines DECSC + ?47 + clear). Modern applications should use ?1049 instead — ?47 is preserved for backwards compatibility with older xterm clients and historical TUI software. Most terminal emulators still implement it, though some treat it as an alias for ?1047.
How this is testedautomated
Send \x1b[?47h (DECSET 47), verify altScreen mode is active, then exit with \x1b[?47l.

The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.

Analysis2026-04-06

Supported by 7 of 9 terminals (78%). Not supported by: vt100.js, Alacritty. Part of the Modern TUI baseline. Notes: vt100.js: Alt screen variants not supported in vt100.js baseline; Alacritty: Legacy ?47 alt screen not supported by alacritty.

Supported by 9 of 14 backends (64%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yesBehavioral: ?47 enter/exit accepted
Ghostty1.3.1✓ yesBehavioral: ?47 enter/exit accepted
Terminal.app2.15✓ yesBehavioral: ?47 enter/exit accepted
Kitty0.46.2✓ yesBehavioral: ?47 enter/exit accepted
VS Code1.113.0? unknown
Warp0.2026.03.18.08.24.03? unknown
Cursor2.6.21? unknown

Headless Backends

Parser correctness only — a means the parser accepts the sequence.

BackendVersionSupportNotes
vterm0.2.0✓ yes
WezTerm0.1.0-fork.5✓ yes
xterm.js5.5.0✓ yes
Alacritty0.26.0✗ noLegacy ?47 alt screen not supported by alacritty
vt100.js0.2.1✗ noAlt screen variants not supported in vt100.js baseline