wire / terminal-osc / 11

OSC 11 — Set / query default background color

OSC 11 ; spec ST sets the terminal's default background color; OSC 11 ; ? ST queries it, replied as OSC 11 ; rgb:RRRR/GGGG/BBBB ST. Programs query OSC 11 to detect a light-vs-dark background and adapt their colors. Mirrors OSC 10 for the foreground.

terminal-osc kind control-sequence status de-facto verification verified tier B terminal-escape@1

aka: set background color · query background · OSC 11 · ESC ] 11 · default bg · detect dark mode

frame

OSC introducer: \x1b] ESC ] (0x1B 0x5D)

terminator (ST|BEL): ST \x1b\ · BEL \x07

parameters / subcommands

idnamebytes (ST)meaning
set Set default background \x1b]11;#000000\x1b\ OSC 11 ; spec ST sets the default background color (X11 name or rgb:/# form).
query Query default background \x1b]11;?\x1b\ OSC 11 ; ? ST asks for the current background; reply OSC 11 ; rgb:RRRR/GGGG/BBBB ST. The de-facto way to detect light vs dark themes.

gotchas


provenance

per-fact attribution:

see also

agent: curl -H 'accept: application/json' wire.phall.io/terminal-osc/11 or /terminal-osc/11.json