ZDM Zero Default Mode
Whether a parameter of 0 means zero or the default.
CSI 22 h
Mode 22 decides what a parameter of 0 means. Reset, it means the number zero; set, it means the default, so CSI 0 C moves one column like CSI C. The first edition of ECMA-48 treated 0 as the default, and the mode was kept for implementations of it; the fifth edition deprecates it and moved it to an annex.
| State | ECMA-48 calls it | Meaning |
|---|---|---|
Reset, CSI 22 l | ZERO | 0 is the number zero |
Set, CSI 22 h | DEFAULT | 0 is the default value |
Terminals behave as if the mode were set. In xterm and libghostty-vt a 0 given to a count, as in CUF or ICH, means one, the same as leaving it out, whatever the mode says.
Neither xterm nor libghostty-vt implements it. Both ignore CSI 22 h and CSI 22 l, and both answer DECRQM with 0, not recognized: the mode is not among the ones xterm’s do_ansi_rqm answers for.
Validation
ZDM-1: Not recognized
\e[22$p
|_____|
reply \e[22;0$y
ZDM-2: Not recognized after it is set, either
\e[22h
\e[22$p
|_____|
reply \e[22;0$y
ZDM-3: A zero is still the default
\e[22l # zero means zero: ignored
A
\e[0C # moves one column
B
|A_B__|
cursor 1,4