DECRST DEC Private Mode Reset
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.
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