^[control-codes
live in libghostty-vt

Device control strings

XTGETXRES Request Resource Values

View as Markdown

Ask xterm for the value of one of its X resources.

DCS + Q Pt ST
xterm
Device-Control functions

DCS + Q Pt ST asks for the values of xterm’s X resources, its settings, by name: Pt is the names in hexadecimal, separated by ;, like XTGETTCAP’s. The answer is DCS 1 + R name=value ST, with the value in hexadecimal as well, and the pairs for several names separated by ;. A name it does not have is written back with no value, and whether the answer starts 1 or 0 depends only on the first name (XTGETXRES, vt100ResourceToString). Booleans come back as true or false, numbers in decimal, and strings as they are; a string resource that is not set has no value to give.

A program can use it to find out, for instance, whether xterm will let it manipulate the window before trying (allowWindowOps). xterm always allows it. The cases ask for resources whose values in a default xterm come from its defaults: allowWindowOps is false, saveLines is 1024, and decTerminalID is 420.

The names are X resource names, so no other terminal has the same set, and libghostty-vt does not implement it: it consumes the string and does not answer. The cases are known differences.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984Nonot in the manual
VT510manual, 1st ed., 1993Nonot in the manual
xtermpatch 412, xterm-411aYes
libghostty-vt0f171f6Noconsumed without an answer (XTGETXRES-1 to XTGETXRES-3)
kitty0.49.1, run in a VMNofails the case that shows it working
foot1.28.0, run in a VMNofails the case that shows it working
pyte0.8.2, run as a libraryNofails the case that shows it working
xterm.js headless6.0.0, run as a libraryNofails the case that shows it working
alacritty_terminal0.26.0, run as a libraryNofails the case that shows it working
ConEmubuild 230724, its documentationNonot in ConEmu’s list, which has no DCS; ANSI escape codes
rxvt-unicode9.31, run in a VMNofails the case that shows it working
VTE0.84.1, run as a libraryNofails the case that shows it working

Validation

XTGETXRES-1: A boolean

\eP+Q616C6C6F7757696E646F774F7073\e\\  # allowWindowOps
|______|
reply \eP1+R616C6C6F7757696E646F774F7073=66616C7365\e\\

XTGETXRES-2: Two at once

\eP+Q736176654C696E6573;6465635465726D696E616C4944\e\\  # saveLines;decTerminalID
|______|
reply \eP1+R736176654C696E6573=31303234;6465635465726D696E616C4944=343230\e\\

XTGETXRES-3: A name it does not have

\eP+Q6E6F537563684E616D65\e\\  # noSuchName
|______|
reply \eP0+R6E6F537563684E616D65\e\\

XTGETXRES-4: Nothing on screen

A
\eP+Q736176654C696E6573\e\\
B
|AB____|
cursor 1,3
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.