^[control-codes live in libghostty-vt

Private modes

XTLOGGING Start Logging or DECGPBM Graphics Print Background Mode

Start or stop logging the session to a file, in an xterm built to log; DECGPBM on a VT340.

CSI ? 46 h
xterm
Functions using CSI

CSI ? 46 h starts xterm logging everything it receives to a file, and CSI ? 46 l stops it; OSC 46 names the file. DEC used the same number on its VT340 for DECGPBM, Graphics Print Background Mode, which xterm takes it to mean instead when it emulates a terminal with ReGIS graphics.

A default xterm has neither. Logging is compiled in only with --enable-logging, and even then a program can turn it on and off only if xterm was also built with ALLOWLOGFILEONOFF; otherwise the sequence rings the bell twice and DECRQM reports the mode as permanently set or reset. The graphics printing that DECGPBM controls is compiled in only with ReGIS graphics, which is off too (dpmodes, do_dec_rqm). So a default xterm does not recognize mode 46 at all: it ignores CSI ? 46 h and answers DECRQM for it with 0.

libghostty-vt does not have the mode either, and does the same. The cases pass.

Validation

XTLOGGING-1: Not recognized

\e[?46$p
\e[?46h
\e[?46$p
|______|
reply \e[?46;0$y\e[?46;0$y

XTLOGGING-2: Nothing happens

A
\e[?46h
B
\e[?46l
|AB____|
cursor 1,3
bell 0
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.