SL / SR — Scroll left / right (CSI Ps SP @ / CSI Ps SP A)
Scroll the screen content left (SL) or right (SR) by Ps columns — the horizontal counterpart of CSI S / CSI T.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b[<Ps> @ (SL) \x1b[<Ps> A (SR)\033[1 @ / \033[1 A\e[1 @ / \e[1 AESC [ Ps SP @ / ESC [ Ps SP A1b 5b ... 20 40 / 1b 5b ... 20 41Description
Shifts every cell on the screen (or within the active DECSTBM / DECSLRM region) `Ps` columns left (SL — final bytes `SP @`) or right (SR — final bytes `SP A`). Columns scrolled off the edge are discarded; the opposite edge is filled with blanks using the current SGR background. The intermediate byte is **literal space (0x20)** between the parameter and the final byte — easy to miss because the canonical ECMA-48 notation writes it as `SP`. SR shares its final byte `A` with CUU (cursor-up) but is unambiguous because of the intermediate space — parsers must distinguish on the presence of any 0x20..0x2f byte before the final. Common use-case is wide-table or code-viewer panes that scroll horizontally without redrawing the rest of the screen. Support is markedly thinner than vertical scroll (CSI S / CSI T) — Linux console, ConPTY, and several xterm clones treat SL/SR as a no-op.
Spec citation: ECMA-48 §8.3.121 (SL) / §8.3.135 (SR) / xterm-ctlseqs
Parameters
| Ps | Number of columns to scroll. Default 1 if omitted; values larger than the region width clear the region. |
Examples
printf '\033[3 @' # scroll screen 3 cols left (note literal SPACE before @)import sys; sys.stdout.write('\x1b[1 A') # scroll 1 col rightfmt.Print("\x1b[2 @") // scroll 2 cols leftprocess.stdout.write('\x1b[1 A') // scroll 1 col rightprintf("\x1b[5 @"); // scroll 5 cols leftTerminal support
- xterm
- yes
- Linux console (fbcon)
- no
- macOS Terminal.app
- no
- iTerm2
- partial
- Windows Terminal
- no
- cmd.exe / ConPTY
- no
- kitty
- yes
- alacritty
- partial
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- partial
- 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 | no | no | partial | no | no | yes | partial | yes | yes | partial | yes | no | no |