^[control-codes live in libghostty-vt

Operating system commands

OSC 30001 Push Colors

Save the colors on kitty's stack.

OSC 30001 ST
ECMA-48
§8.3.89 OSC – Operating System Command, p. 51
Specification
Color control, kitty documentation

OSC 30001 ST pushes the terminal’s colors onto a stack, and OSC 30101 pops them off again.

kitty saves the colors on a stack, so that a program with its own color scheme can put back whatever the user had set when it exits. Its Color control document defines the pair: what is saved is the default foreground and background, the selection’s colors, the cursor’s, and the 256 palette colors. It notes that xterm later added its own way to do the same, with control sequences rather than OSCs, and that kitty accepts those too.

A default xterm ignores both numbers, which are not among the OSC numbers it knows, and so does libghostty-vt.

Validation

OSC30001-1: Nothing on screen, nothing answered

A
\e]30001\e\\
B
|AB__|
cursor 1,3
reply none
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.