Skip to main content

DECSCUSR

AI-Generated Content
This page was generated with the assistance of AI and may contain inaccuracies. It is intended as a placeholder for future human verification. If you spot issues ahead of its initial review, please report them on GitHub!
Standard

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
Formal syntax
DECSCUSR = 0x1b, "[", [ Ps ], " ", "q" ;
Ps       = "0" | "1" | "2" | "3" | "4" | "5" | "6" ;   (* default: 0 *)

Parameters​

ValueDescription
0Default cursor shape (typically blinking block)
1Blinking block
2Steady block
3Blinking underline
4Steady underline
5Blinking bar (I-beam)
6Steady 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​

SpecificationSection
VT510 Reference—

Terminal support​

TerminalSupportVersionNotes
Terminal Emulators
Alacritty✓v0.7.0
Bobcat✓0.9.0Supported via TerminalCtrl library; configurable via profile settings in Bobcat (Terminal.cpp:488-497)
contour✓v0.1.0
foot✓YesImplemented at csi.c:1798-1832, supports all cursor styles
Ghostty✓v1.0.0
iTerm2✓YesCursor style control fully implemented via VT100CSI_DECSCUSR (CSI SP q). Supports blinking/steady block, underline, and vertical bar cursors (params 0-6).
Kitty✓YesSupports cursor shapes: block, underline, beam
Konsole✓YesSupports block, underline, and bar cursor styles with blink control via CSI Ps SP q
mintty✓YesImplemented at src/termout.c:3517-3523. Supports cursor style (block/underline/bar) and blink control.
mlterm✓rel-3_8_2
PuTTY✗NoNo implementation found in escape sequence parser
Rio✓v0.0.6
rxvt-unicode✓9.19
st✓0.6
terminology✓v1.10.0Full support for block, underline, and bar cursor shapes
VT100✗No
VTE✓YesSupports 6 cursor styles: blinking/steady block, underline, and I-beam
WezTerm✓20191229-193639-e7aa2f3
Windows Terminal✓YesFull support for all cursor styles (block, underline, bar) with blinking/steady variants
xterm✓xterm-282
xterm.js✓2.3.0
Multiplexers
cy✓v0.1.0Supports all cursor styles (block, underline, bar) with blinking variants
GNU Screen✓v.5.0.0CSI Ps SP q implemented at src/ansi.c:1065
tmux✓1.7
tuios✓v0.0.15
Zellij✓v0.12.0Supports all cursor styles: block, underline, and bar (steady and blinking)

See also​