^[control-codes
live in libghostty-vt

Control sequences

DECRST DEC Private Mode Reset

View as Markdown

Turn one or more DEC private modes off.

CSI ? Pm l
DEC STD 070
§5.10.1.2 DEC Private Modes, p. 5-133
VT220
§4.6.2 Reset Mode (RM)
VT510
RM—Reset Mode
xterm
Functions using CSI

CSI ? Pm l resets one or more DEC private modes, the ones DECSET, CSI ? Pm h, sets. It is RM with a ? in front of the parameters, and the ? changes what every number means: CSI 4 l is replace mode, but CSI ? 4 l is jump scrolling. Each mode has a page under private modes.

DEC’s manuals do not call it DECRST. To them it is RM, Reset Mode, with a ?: DEC STD 070 lists the private modes in its table of SM and RM parameters, and the VT220 and VT510 manuals describe both forms under RM. The names DECSET and DECRST are xterm’s, from its list of control sequences, and are the ones most documentation uses now.

Each parameter names one mode, and they are reset in order, with the same rules as DECSET: a 0 is an error and is ignored, as is any number the terminal does not know, and ANSI and private parameters cannot be mixed. xterm resets each mode in turn in dpmodes, and so does libghostty-vt.

Resetting a mode is not always a matter of a flag. Some modes act when they change: resetting DECCOLM clears the screen, once mode 40 allows it to act at all, and resetting 1049 leaves the alternate screen and restores the cursor. Each mode’s page says what its reset does.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Yes§4.6.2 Reset Mode (RM), as RM with ?
VT510manual, 1st ed., 1993YesRM, as RM with ?
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6Yes
kitty0.49.1, run in a VMPartlyfails DECRST-2, DECRST-3, DECRST-4 of the 4 cases that show it working
foot1.28.0, run in a VMYespasses the 4 cases that show it working
pyte0.8.2, run as a libraryYespasses the 3 cases that show it working
xterm.js headless6.0.0, run as a libraryYespasses the 4 cases that show it working
alacritty_terminal0.26.0, run as a libraryYespasses the 4 cases that show it working
ConEmubuild 230724, its documentationPartlyonly private modes 1, 25, 47, 1047 to 1049, 2004 and the mouse modes; ANSI escape codes
rxvt-unicode9.31, run in a VMYespasses the 4 cases that show it working
VTE0.84.1, run as a libraryYespasses the 4 cases that show it working

Validation

DECRST-1: Two modes in one sequence

\e[?7;25l  # no autowrap, no cursor
\e[?7$p
\e[?25$p
|_____|
reply \e[?7;2$y\e[?25;2$y

DECRST-2: Autowrap off

\e[?7l
ABCDEFG   # F and G go to the last column
|ABCDG|
|_____|
cursor 1,5

DECRST-3: A mode that is not known does not stop the others

\e[?0;9999;7l  # 0 is an error, 9999 is no mode
ABCDEFG
|ABCDG|
|_____|
cursor 1,5

DECRST-4: Without the question mark it is a different mode

\e[7l      # VEM, not DECAWM
ABCDEFG
|ABCDE|
|FG___|
cursor 2,3
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.