DECRQM — Request Mode Status (CSI ? Ps $ p)
Ask the terminal whether a specific DEC private mode is enabled — used for feature detection at runtime.
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\x1b[?Ps$p\033[?Ps$p\e[?Ps$pESC [ ? Ps $ p1b 5b 3f <Ps> 24 70Description
Request Mode (DEC variant). The intermediate `$` (0x24) and final `p` (0x70) make this a DECRQM frame for a DEC private mode `Ps`. Reply: `\x1b[?Ps;Pm$y` where `Pm` is 0 (mode not recognised), 1 (set / enabled), 2 (reset / disabled), 3 (permanently set), or 4 (permanently reset). This is the canonical way for an application to ask, at runtime, whether a feature it wants is actually available — `\x1b[?2026$p` for synchronized output, `\x1b[?1004$p` for focus events, `\x1b[?2004$p` for bracketed paste, `\x1b[?1006$p` for SGR mouse encoding. Without DECRQM, apps degrade to optimistic emission + hope. Note: the ANSI-mode variant (no `?`) `\x1b[Ps$p` queries non-DEC modes like KAM, IRM, SRM.
Spec citation: xterm-ctlseqs (DECRQM, CSI ? Ps $ p)
Examples
printf '\033[?2026$p' # is synchronized-update mode available?import sys; sys.stdout.write('\x1b[?2026$p')fmt.Print("\x1b[?2026$p")process.stdout.write('\x1b[?2026$p')printf("\x1b[?2026$p");Terminal support
- xterm
- yes
- Linux console (fbcon)
- partial
- macOS Terminal.app
- partial
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- no
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | partial | partial | yes | yes | no | yes | yes | yes | yes | yes | yes | no | no |