^[control-codes live in libghostty-vt

Escape sequences

NEL Next Line

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
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.

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.