LNM Line Feed/New Line Mode
Make a line feed return to the first column as well.
CSI 20 h/l
- 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.
| State | Meaning |
|---|---|
Reset, CSI 20 l | LF, VT and FF move down only |
Set, CSI 20 h | LF, 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.
Support
| Terminal | Version | Support | Notes |
|---|---|---|---|
| VT220 | manual, 2nd ed., 1984 | Yes | §4.6.6 Line Feed/New Line Mode (LNM) |
| VT510 | manual, 1st ed., 1993 | Yes | LNM |
| xterm | patch 412, xterm-411a | Yes | |
| libghostty-vt | 0f171f6 | Yes | |
| kitty | 0.49.1, run in a VM | Yes | passes the 4 cases that show it working |
| foot | 1.28.0, run in a VM | No | fails the 4 cases that show it working |
| pyte | 0.8.2, run as a library | Yes | passes the 2 cases that show it working |
| xterm.js headless | 6.0.0, run as a library | Yes | passes the 4 cases that show it working |
| alacritty_terminal | 0.26.0, run as a library | Partly | fails LNM-1, LNM-2 of the 4 cases that show it working |
| ConEmu | build 230724, its documentation | Yes | ANSI escape codes |
| rxvt-unicode | 9.31, run in a VM | No | fails the 4 cases that show it working |
| VTE | 0.84.1, run as a library | No | fails the 4 cases that show it working |
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