^[control-codes live in libghostty-vt

ANSI modes

LNM Line Feed/New Line Mode

Make a line feed return to the first column as well.

CSI 20 h
ECMA-48
§F.5.2 Line Feed/New Line Mode (LF/NL), p. 88
DEC STD 070
§5.4.4 New Line Mode, p. 5-57
VT220
§4.6.6 Line Feed/New Line Mode (LNM)
VT510
LNM—Line Feed/New Line Mode
xterm
Functions using CSI

Mode 20 makes a line feed, vertical tab or form feed also move the cursor to the first column, as CR LF would. Reset, which is the default, they only move the cursor down.

StateMeaning
Reset, CSI 20 lLF, VT and FF move down only
Set, CSI 20 hLF, VT and FF also return to the first column

It is not in ECMA-48 any more. The fourth edition deprecated it and the fifth, the one this site follows, removed it, so mode 20 is now “shall not be used”. DEC terminals still have it: DEC STD 070 defines it, and says that conforming software should not set it. The VT510 manual adds that the mode also decides what the Return key sends, and advises keeping it reset for compatibility with Digital’s software.

xterm keeps the mode (ansi_modes), and so does libghostty-vt, and both answer DECRQM with its state.

Validation

LNM-1: Line feed/new line mode

\e[20h    # LNM
AB
\n
C
\e[20l
\n
D
|AB___|
|C____|
|_D___|

LNM-2: Vertical tab and form feed too

\e[20h    # LNM
AB
\v
C
\f
D
|AB___|
|C____|
|D____|
cursor 3,2

LNM-3: Reset by default

\e[20$p
|_____|
reply \e[20;2$y

LNM-4: Set

\e[20h
\e[20$p
|_____|
reply \e[20;1$y
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.