^[control-codes
live in libghostty-vt

Operating system commands

OSC 30101 Pop Colors

View as Markdown

Restore the colors from kitty's stack.

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

OSC 30101 ST pops the colors that OSC 30001 pushed, and puts them back.

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.

Support

TerminalVersionSupportNotes
VT220manual, 2nd ed., 1984NoOSC is not among the controls it recognizes (§4.2)
VT510manual, 1st ed., 1993Noignores an OSC string (chapter 4)
xtermpatch 412, xterm-411aNoignored
libghostty-vt0f171f6Noignored
Konsole26.11.70, a24c3d71Nonot in its source
kitty0.49.2, its documentationYesColor control
ConEmubuild 230724, its documentationNonot in its ANSI escape codes

Validation

OSC30101-1: A change made after the push stays

\e]10;blue\a
\e]30001\e\\
\e]10;red\a
\e]30101\e\\   # ignored
\e]10;?\a
|____|
reply \e]10;rgb:ffff/0000/0000\a
Every example on these pages runs in your browser, in libghostty-vt compiled to WebAssembly.