Appearance
Cursor
The cursor is the active write position. Programs move it explicitly; characters output advance it implicitly.
Position
The cursor has a (row, column) position, 1-indexed. (1, 1) is the top-left of the active region.
- Move absolute: CUP —
CSI <r>;<c> H - Move relative: CUU / CUD / CUF / CUB —
A/B/C/D - Save / restore: DECSC / DECRC —
ESC 7/ESC 8
Style
Selectable per program:
block— the default, fills the cell.underline— a line at the cell baseline.beam— a thin vertical line on the left edge.
Set with DECSCUSR — CSI <n> SP q. User defaults via the cursor-style config key.
Blink
Each style has a blinking and a steady variant. DECSCUSR encodes both into the same parameter.
<n> | Style |
|---|---|
0, 1 | Block, blinking |
2 | Block, steady |
3 | Underline, blinking |
4 | Underline, steady |
5 | Beam, blinking |
6 | Beam, steady |
Blinking can also be toggled independently of the shape with DEC private mode 12 (CSI ? 12 h = blink, CSI ? 12 l = steady).
Whether a program's blink request is honored depends on the cursor-style-blink policy: the default_* values defer to the program, while always_* pin the blink and ignore both DECSCUSR's blink bit and DEC mode 12. The cursor shape always follows the program. See Cursor and Mouse and the cursor-style-blink reference.
A program can read the current cursor style back with DECRQSS: DCS $ q SP q ST → Otty replies DCS 1 $ r <n> SP q ST with the code from the table above.
Visibility
Show / hide with DEC private modes ?25h / ?25l. Hidden cursor is common in TUIs that draw their own.
Origin mode
DECOM (?6) makes CUP positions relative to the active scrolling region. Off by default.