Skip to main content
ansicode

DECREQTPARM / DECREPTPARM — Request and report terminal parameters (`CSI Ps x`)

VT100-era legacy probe — ask the terminal for its serial-line parameters (parity, bit-count, baud, clock multiplier, flags). Predates DA / DA2 / XTVERSION; almost never the right tool now, but xterm and most modern emulators still answer with synthetic defaults.

Byte forms

Every common string-literal form so you can paste-and-search either direction.

\\x1b[\x1b[<Ps>x
\\033[\033[1x
\\e[\e[1x
ESC [ESC [ Ps x
hex1b 5b ... 78

Description

DECREQTPARM — Request Terminal Parameters — `CSI Ps x`, with `Ps` selecting solicit-vs-unsolicit convention. Originally wired to the VT100's physical serial line: a host could ask 'what baud / parity / bit-count are you set to?' and the terminal answered with its current setup over the same line. **Request**: - `Ps = 0` — terminal MAY thereafter send unsolicited DECREPTPARM responses (effectively obsolete; almost no emulator honours this — it's a relic of host-managed setup over a multidrop line). - `Ps = 1` — request a solicited response NOW. **Reply (DECREPTPARM)** — `\x1b[<sol>;<par>;<nbits>;<xspeed>;<rspeed>;<clkmul>;<flags>x` - `sol` = `2` if unsolicited, `3` if solicited (matches your request). - `par` = parity — `1` = none, `4` = odd, `5` = even. - `nbits` = data bits — `1` = 8, `2` = 7. - `xspeed` = transmit speed code (e.g. `16` = 9600, `24` = 38400, `88` = synthetic 'fast' on most emulators). - `rspeed` = receive speed code (usually equal to `xspeed`). - `clkmul` = clock multiplier (always `1` for real VT100; modern emulators echo `1`). - `flags` = STP / SET-UP / TIME bitfield (always `0` on modern emulators). **What modern emulators do**: - **xterm**: full reply with sensible defaults — typically `\x1b[3;1;1;112;112;1;0x` or `\x1b[3;1;1;88;88;1;0x` depending on build. The speed code is synthetic and not meaningful. - **kitty**, **wezterm**, **ghostty**, **iTerm2**, **alacritty**, **Konsole**: each implements just enough to not hang a legacy probe — typically returning `\x1b[3;1;1;112;112;1;0x` or similar. - **gnome-terminal**: same synthetic shape. - **Windows Terminal**: replies on builds ≥ 1.18; older builds silent. - **macOS Terminal**: silent — does not respond. Probes hang until timeout. - **cmd.exe / ConPTY**: silent. - **Linux console** (`vt`): replies with `\x1b[3;1;1;112;112;1;0x` on most kernels. **Should you actually use this in 2026?** Probably never. The reply gives you zero information beyond 'the terminal is alive and speaks ECMA-48', which DA1 (`\x1b[c` — see `csi-da`) already answers more cleanly with a model ID. If you find DECREQTPARM in a legacy codebase, it's almost certainly a relic of VT100-era serial-line setup code that never got modernised. Replace with: - `csi-da` (DA1, `\x1b[c`) for 'is this a VT-class terminal' / what model. - `csi-da2-decoder` (DA2, `\x1b[>c`) for emulator class + firmware version. - `xtversion` (`\x1b[>0q`) for specific emulator name + version (xterm-family extension). **If you must use it**: send `\x1b[1x`, read reply on stdin matching `\x1b\[3;\d+;\d+;\d+;\d+;\d+;\d+x`. **Time out at 100 ms** — macOS Terminal users will leave you hanging otherwise. Don't treat `xspeed`/`rspeed` as a real baud rate; emulators emit constants. The only field that occasionally carries signal is `par` (parity), and only on serial-attached emulators (gtkterm, picocom — both outside our 12-emulator support row).

Spec citation: DEC VT100 User Guide §4 (DECREQTPARM / DECREPTPARM) / xterm-ctlseqs (CSI Ps x)

Parameters

Ps0 = enable unsolicited DECREPTPARM (almost universally ignored). 1 = request one solicited DECREPTPARM reply now.

Examples

bash
# Solicited probe — read reply non-blocking with 100ms timeout.\nprintf '\\033[1x'\nIFS= read -rs -d x -t 0.1 reply </dev/tty 2>/dev/null\necho \"DECREPTPARM: ${reply#$'\\033'}x\"   # expect \\x1b[3;1;1;<spd>;<spd>;1;0x
python
import sys, re\nsys.stdout.write('\\x1b[1x'); sys.stdout.flush()   # DECREQTPARM solicited\n# ... terminal-aware read of reply (cbreak + select + timeout) ...\n# Match: \\x1b[(\\d+);(\\d+);(\\d+);(\\d+);(\\d+);(\\d+);(\\d+)x\n# Fields: sol par nbits xspeed rspeed clkmul flags
go
// DECREQTPARM — expect \"\\x1b[3;...x\" reply within 100ms or fall back to DA1.\nfmt.Print(\"\\x1b[1x\")
javascript
// Node: probe + parse + fallback.\nprocess.stdout.write('\\x1b[1x');\n// On stdin 'data', match /\\x1b\\[3;(\\d+);(\\d+);(\\d+);(\\d+);(\\d+);(\\d+)x/\n// — fields are mostly synthetic on modern emulators; prefer DA1 + XTVERSION.
c
/* Fire-and-forget DECREQTPARM; most modern emulators answer with constants. */\nprintf(\"\\x1b[1x\"); fflush(stdout);\n/* Parse reply (cbreak terminal): sscanf returned buf,\n *   \"\\x1b[%d;%d;%d;%d;%d;%d;%dx\",\n *   &sol, &par, &nbits, &xspd, &rspd, &clkmul, &flags); */

Terminal support

xterm
yes
Linux console (fbcon)
yes
macOS Terminal.app
no
iTerm2
yes
Windows Terminal
partial
cmd.exe / ConPTY
no
kitty
yes
alacritty
yes
WezTerm
yes
Ghostty
yes
GNOME Terminal
yes
Konsole
yes
tmux
no
GNU screen
no

Related sequences