Skip to content

Alt screen clear-on-enter (?1047)

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

CSI ? 1047 h/l
DECSET 1047 enters the alternate screen buffer and clears it on entry. The sequence is ESC [ ? 1047 h to enter, ESC [ ? 1047 l to exit (which also clears the alt screen before switching back). Unlike ?1049, mode 1047 does not save or restore the cursor position — applications using ?1047 must combine it with explicit DECSC/DECRC (ESC 7 / ESC 8) if they want cursor preservation. Mode 1047 is one of the building blocks that mode 1049 composes (along with cursor save and clear). Most terminal emulators implement all three (?47, ?1047, ?1049) so legacy software keeps working alongside modern apps.
How this is testedautomated
Send \x1b[?1047h, verify altScreen mode is active.

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 8 of 9 terminals (89%). Not supported by: vt100.js. Part of the Modern TUI baseline. Notes: vt100.js: Alt screen variants not supported in vt100.js baseline.

Supported by 9 of 14 backends (64%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yesDECRPM: mode reset
Ghostty1.3.1✓ yesDECRPM: mode reset
Terminal.app2.15✓ yesBehavioral: ?1047 accepted
Kitty0.46.2✓ yesBehavioral: ?1047 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~ partial?1047 alt screen (with clear) not exposed in headless mode
vt100.js0.2.1✗ noAlt screen variants not supported in vt100.js baseline