XTSETTCAP Set Termcap Data
Tell xterm which terminal description to take its function keys from.
DCS + p Pt ST
- xterm
- Device-Control functions
DCS + p Pt ST gives xterm the name of a terminal description, in hexadecimal like the names XTGETTCAP takes. xterm looks it up in the system’s terminfo or termcap, and from then on, when its keyboard is in termcap mode (-tcap, or CSI ? 1050 h), its function keys send what that description says they send. An empty name, one that is not in hexadecimal, or one that cannot be found rings the bell instead (XTSETTCAP, set_termcap). A default xterm allows it: its disallowedTcapOps names SetTcap, but that list applies only when allowTcapOps is off, and it is on.
Its keyboard is not in termcap mode by default, so the only thing a case can see is the bell. The cases follow xterm, and assume no terminal description called no-such-terminal is installed.
libghostty-vt does not implement it, and consumes the string without ringing the bell, so the cases that expect the bell are known differences.
Validation
XTSETTCAP-1: Nothing on screen
A
\eP+p787465726D\e\\ # xterm
B
|AB____|
cursor 1,3
reply none
XTSETTCAP-2: An empty name rings the bell
\eP+p\e\\
|______|
bell 1
XTSETTCAP-3: So does one it cannot find
\eP+p6E6F2D737563682D7465726D696E616C\e\\ # no-such-terminal
|______|
bell 1