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.

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