^[control-codes
live in libghostty-vt

Escape sequences

NEL Next Line

View as Markdown

Move the cursor to the start of the next line, scrolling at the bottom margin.

ESC E
ECMA-48
§8.3.86 NEL – Next Line, p. 51
DEC STD 070
§5.4.4 Next Line, p. 5-64
VT220
§4.7 Cursor Positioning
VT510
NEL—Next Line

Move the cursor to the left margin of the next line. If the cursor is on the bottom margin, the scrolling region scrolls up by one line instead, exactly as for a line feed. DEC STD 070 defines it as a carriage return followed by a line feed, and recommends that software send CR LF instead, “for widest compatibility”.

If the cursor is left of the left margin, or above or below the scrolling region, it goes to the first column of the next line, and never past the last line of the screen.

NEL is a C1 control. ECMA-48 defines it both as the single byte 85 and as ESC E. A terminal reading UTF-8 accepts only ESC E: the code point U+0085 sent as UTF-8 is ignored, and a lone 85 byte is not valid UTF-8. A default xterm ignores that byte too when printable text follows it, taking it as U+0085; libghostty-vt prints U+FFFD, the replacement character, so that case is a known difference. The UTF-8 page has the details.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Yes§4.7 Cursor Positioning
VT510manual, 1st ed., 1993YesNEL
xtermpatch 412, xterm-411aYesa lone 85 byte is ignored before text
libghostty-vt0f171f6YesNEL-4: prints a lone 85 byte as U+FFFD
kitty0.49.1, run in a VMPartlyfails NEL-3 of the 3 cases that show it working
foot1.28.0, run in a VMPartlyfails NEL-3 of the 3 cases that show it working
pyte0.8.2, run as a libraryNofails the 3 cases that show it working
xterm.js headless6.0.0, run as a libraryPartlyfails NEL-3 of the 3 cases that show it working
alacritty_terminal0.26.0, run as a libraryPartlyfails NEL-3 of the 3 cases that show it working
ConEmubuild 230724, its documentationYesESC E, listed as the same as \r\n, in ANSI escape codes
rxvt-unicode9.31, run in a VMPartlyfails NEL-3 of the 3 cases that show it working
VTE0.84.1, run as a libraryYespasses the 3 cases that show it working

Validation

NEL-1: Down and back

AB
\eE
C
|AB___|
|C____|
|_____|
cursor 2,2

NEL-2: Scrolls at the bottom

A\r\nB\r\nC
\eE
D
|B____|
|C____|
|D____|

NEL-3: To the left margin

\e[?69h   # allow left and right margins
\e[3;5s   # margins at columns 3 and 5
\e[1;4H
\eE
X
|_____|
|__X__|

NEL-4: The 8-bit forms

A
\x85       # a lone byte: xterm ignores it before text
B
\u{85}     # U+0085 as UTF-8: ignored
C
|ABC__|
|_____|
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.