wire / terminal-dec-private-mode / 1047

DECSET 1047 — Alternate screen buffer (clear on exit)

CSI ? 1047 h switches to the alternate screen buffer; CSI ? 1047 l switches back to the normal buffer AND clears the alternate buffer as it leaves. Unlike 47 it tidies the alt buffer on exit, but unlike 1049 it does not save/restore the cursor. Usually combined with 1048; 1049 is the all-in-one.

terminal-dec-private-mode kind control-sequence status de-facto verification verified tier B terminal-escape@1

aka: alternate screen · alt buffer clear · DECSET 1047 · ?1047h / ?1047l

frame

DEC-private-mode introducer: \x1b[? ESC [ ? (0x1B 0x5B 0x3F)

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
set Enable (DECSET) \x1b[?1047h CSI ? 1047 h switches to the alternate screen buffer.
reset Disable (DECRST) \x1b[?1047l CSI ? 1047 l switches back to the normal buffer and CLEARS the alternate buffer on the way out (unlike legacy mode 47).

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-dec-private-mode/1047 or /terminal-dec-private-mode/1047.json