Skip to content

DECRQSS — Request Selection or Setting

SequenceDCS $ q D…D ST
Bytes0x1B 0x50 0x24 0x71 <D…D> 0x1B 0x5C
MnemonicDECRQSS
Otty support◑ Partial — cursor style only

Description

DECRQSS lets a program read back the terminal's current setting for a control function, instead of assuming its own last write took effect. The request names the control function by its final (and intermediate) bytes in D…D; the terminal replies with the value it would emit for that function.

Request:  DCS $ q D…D ST
Reply:    DCS Ps $ r D…D ST      Ps = 1 (valid) or 0 (unsupported)

Otty answers the cursor style query (DECSCUSR, CSI Ps SP q). Its identifier is SP q (space, q), so the full exchange is:

RequestDCS $ q SP q ST — bytes 1B 50 24 71 20 71 1B 5C
ReplyDCS 1 $ r <Ps> SP q ST

<Ps> is the current cursor code, matching DECSCUSR:

PsStyle
1Block, blinking
2Block, steady
3Underline, blinking
4Underline, steady
5Beam, blinking
6Beam, steady

The reply reports the cursor style the VT currently holds — a program's DECSCUSR override if one is active, otherwise the configured default. tmux and some TUIs probe this on startup to learn the cursor shape and restore it later.

What is not answered

Other DECRQSS targets — SGR (m), the scrolling region (r), and so on — and the sibling DCS + q … ST (XTGETTCAP, terminfo capability query) are not answered: vte doesn't dispatch general DCS payloads. Programs probing those get no reply and fall back to their defaults.

Example

bash
# Ask for the current cursor style; the reply prints as an escape string.
printf '\eP$q q\e\\'

Otty