Skip to content

DECSCUSR — Set Cursor Style

SequenceCSI <n> SP q
Bytes0x1B 0x5B <n> 0x20 0x71
MnemonicDECSCUSR
Otty support

Description

Sets the cursor shape and blink state. Note the literal SP (space, 0x20) between the parameter and the final q.

<n>Style
0, 1Block, blinking
2Block, steady
3Underline, blinking
4Underline, steady
5Beam, blinking
6Beam, steady

Programs that set the cursor style typically restore it (or send 0) before exiting. The user default lives in the config (cursor-style and cursor-style-blink).

The shape always takes effect. The blink bit is honored only when the cursor-style-blink policy is one of the default_* values; the always_* values pin the blink and ignore it (as well as DEC mode 12). A program can query the current style with DECRQSS (DCS $ q SP q ST).

Example

bash
printf '\e[5 q'      # beam, blinking
printf '\e[2 q'      # block, steady
printf '\e[0 q'      # back to user default

Try it

otty features try cursor-shape — cycles through every DECSCUSR shape with 700 ms holds so you can eyeball each one.

Otty