wire / terminal-dec-private-mode / 1048

DECSET 1048 — Save / restore cursor

CSI ? 1048 h saves the cursor position (and attributes), exactly like DECSC (ESC 7); CSI ? 1048 l restores it, like DECRC (ESC 8). It exists so the save/restore can be combined with alt-screen switching (1047) — and 1049 is precisely 1047 + 1048 in one mode.

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

aka: save cursor · restore cursor · DECSET 1048 · ?1048h / ?1048l

frame

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

terminator (none): ST · BEL

parameters / subcommands

idnamebytes (ST)meaning
set Enable (DECSET) \x1b[?1048h CSI ? 1048 h saves the cursor position and attributes (equivalent to DECSC / ESC 7).
reset Disable (DECRST) \x1b[?1048l CSI ? 1048 l restores the saved cursor position and attributes (equivalent to DECRC / ESC 8).

gotchas


provenance

per-fact attribution:

see also

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