DECSCUSR
DECSCUSR (Set Cursor Style) is a CSI sequence that changes the cursor's shape and blink state.
Syntax
CSI Ps SP q DECSCUSR — Set Cursor Style
DECSCUSR = 0x1b, "[", [ Ps ], " ", "q" ; Ps = "0" | "1" | "2" | "3" | "4" | "5" | "6" ; (* default: 0 *)
Parameters
| Value | Description |
|---|---|
0 | Default cursor shape (typically blinking block) |
1 | Blinking block |
2 | Steady block |
3 | Blinking underline |
4 | Steady underline |
5 | Blinking bar (I-beam) |
6 | Steady bar (I-beam) |
Description
Per the VT510 manual, DECSCUSR sets the style of the cursor. The original DEC specification only defined values 0-2 (block cursor, blinking or steady). XTerm extended this to include underline (3-4) and bar/I-beam (5-6) styles.
The parameter 0 resets to the terminal's default cursor style. Values 1 and 0 often behave identically (blinking block), though this varies by terminal.
Odd values select blinking cursors; even values select steady (non-blinking) cursors.
The bar (I-beam) cursor styles (5-6) are a widely adopted extension originally from XTerm. Most modern terminals support all six styles, though the exact cursor dimensions and blink rate may vary.
Examples
printf '\e[2 q' # Steady block cursor
printf '\e[3 q' # Blinking underline cursor
printf '\e[5 q' # Blinking bar (I-beam) cursor
printf '\e[0 q' # Reset to default cursor style
Specifications
| Specification | Section |
|---|---|
| VT510 Reference | — |
Terminal support
| Terminal | Support | Version | Notes |
|---|---|---|---|
| Terminal Emulators | |||
| Alacritty | ✓ | v0.7.0 | |
| Bobcat | ✓ | 0.9.0 | Supported via TerminalCtrl library; configurable via profile settings in Bobcat (Terminal.cpp:488-497) |
| contour | ✓ | v0.1.0 | |
| foot | ✓ | Yes | Implemented at csi.c:1798-1832, supports all cursor styles |
| Ghostty | ✓ | v1.0.0 | |
| iTerm2 | ✓ | Yes | Cursor style control fully implemented via VT100CSI_DECSCUSR (CSI SP q). Supports blinking/steady block, underline, and vertical bar cursors (params 0-6). |
| Kitty | ✓ | Yes | Supports cursor shapes: block, underline, beam |
| Konsole | ✓ | Yes | Supports block, underline, and bar cursor styles with blink control via CSI Ps SP q |
| mintty | ✓ | Yes | Implemented at src/termout.c:3517-3523. Supports cursor style (block/underline/bar) and blink control. |
| mlterm | ✓ | rel-3_8_2 | |
| PuTTY | ✗ | No | No implementation found in escape sequence parser |
| Rio | ✓ | v0.0.6 | |
| rxvt-unicode | ✓ | 9.19 | |
| st | ✓ | 0.6 | |
| terminology | ✓ | v1.10.0 | Full support for block, underline, and bar cursor shapes |
| VT100 | ✗ | No | |
| VTE | ✓ | Yes | Supports 6 cursor styles: blinking/steady block, underline, and I-beam |
| WezTerm | ✓ | 20191229-193639-e7aa2f3 | |
| Windows Terminal | ✓ | Yes | Full support for all cursor styles (block, underline, bar) with blinking/steady variants |
| xterm | ✓ | xterm-282 | |
| xterm.js | ✓ | 2.3.0 | |
| Multiplexers | |||
| cy | ✓ | v0.1.0 | Supports all cursor styles (block, underline, bar) with blinking variants |
| GNU Screen | ✓ | v.5.0.0 | CSI Ps SP q implemented at src/ansi.c:1065 |
| tmux | ✓ | 1.7 | |
| tuios | ✓ | v0.0.15 | |
| Zellij | ✓ | v0.12.0 | Supports all cursor styles: block, underline, and bar (steady and blinking) |
See also
- DECTCEM — Show/Hide Cursor — Toggle cursor visibility