CNL / CPL — Cursor next / previous line
Move the cursor to column 1 of the line N below (CNL) or above (CPL).
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\\x1b[
\x1b[NE (down N lines, col 1) \x1b[NF (up)\\033[
\033[E / \033[F\\e[
\e[E / \e[FESC [
ESC [ N E / Fhex
1b 5b <N> 45 / 46Description
Final byte `E` = CNL (Cursor Next Line), `F` = CPL (Cursor Previous Line). Both move N rows (defaulting to 1 if omitted) AND reset the column to 1 — unlike CUU/CUD which preserve the column. Equivalent to a CRLF for `E` if you don't care about scroll-region semantics, but CNL respects scrolling regions and never auto-scrolls past the bottom of the region.
Spec citation: ECMA-48 §8.3.13 (CNL) / §8.3.27 (CPL)
Examples
printf 'top\n\033[2Ebottom-of-3rd-line-below\n'import sys; sys.stdout.write('\x1b[3E')fmt.Print("\x1b[3E")process.stdout.write('\x1b[3E')printf("\x1b[3E");Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- yes
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- yes
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | yes | no | no |
Related sequences
In the family cookbook
CSI cookbook · 2. Cursor movement — CUU / CUD / CUF / CUB + CUP + CHA / VPA