Skip to content

ANSI save cursor (CSI s)

Category: cursor · Baseline: modern · Tags: Xterm Extensions · Specification ↗

CSI s
ANSI save cursor (CSI s, i.e. ESC [ s) saves the current cursor position. This is the SCO/ANSI variant of cursor save and is distinct from DECSC (ESC 7): the ANSI form only saves the cursor position (row, column), while DECSC additionally saves character attributes, the active character set, and origin mode. The sequence collides with DECSLRM (Set Left/Right Margins, also CSI Pl ; Pr s) — when DECLRMM (mode 69) is enabled, terminals interpret CSI s with parameters as DECSLRM and the parameter-less form as save cursor. Modern xterm-derived terminals all implement this disambiguation, but some legacy terminals may treat CSI s only as DECSLRM.
How this is testedautomated
Position cursor at (3,5), send \x1b[s (CSI s), move to (10,10), send \x1b[u (CSI u) to restore, verify cursor is back at (3,5).

The same probe runs against headless backends (via Termless) and real terminal apps (via a daemon launched in each terminal). This lets us distinguish parser correctness from rendering correctness.

Analysis2026-04-06

Supported by 7 of 9 terminals (78%). Not supported by: Kitty, Terminal.app. Part of the Modern TUI baseline.

Supported by 8 of 14 backends (57%)

Terminal Applications

TerminalVersionSupportNotes
iTerm23.6.9✓ yes
Ghostty1.3.1✓ yes
Terminal.app2.15✗ nogot 10;15, expected 3;5
Kitty0.46.2✗ nogot 10;15, expected 3;5
VS Code1.113.0? unknown
Warp0.2026.03.18.08.24.03? unknown
Cursor2.6.21? unknown

Headless Backends

Parser correctness only — a means the parser accepts the sequence.

BackendVersionSupportNotes
Alacritty0.26.0✓ yes
vt100.js0.2.1✓ yes
vterm0.2.0✓ yes
WezTerm0.1.0-fork.5✓ yes
xterm.js5.5.0✓ yes