Skip to content

ANSI restore cursor (CSI u)

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

CSI u
ANSI restore cursor (CSI u, i.e. ESC [ u) restores the cursor position previously saved with ANSI save cursor (CSI s). This is the SCO/ANSI variant of cursor restore and is distinct from DECRC (ESC 8): the ANSI form only restores cursor position, while DECRC also restores character attributes, character set, and origin mode. Note that CSI u is also used by the Kitty keyboard protocol as a key event reporting sequence (with parameters and a different context). When sent as input from terminal to application it's a key report; when sent as output from application to terminal it's a cursor restore. Most xterm-derived terminals implement both meanings unambiguously based on direction.
How this is testedautomated
Position cursor at (3,5), send \x1b[s to save, move to (10,10), send \x1b[u (CSI u) to restore, verify cursor returned to (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 12;18, expected 4;6
Kitty0.46.2✗ nogot 12;18, expected 4;6
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