wire / terminal-osc / 11
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.
aka: set background color · query background · OSC 11 · ESC ] 11 · default bg · detect dark mode
OSC introducer: \x1b] ESC ] (0x1B 0x5D)
terminator (ST|BEL): ST \x1b\ · BEL \x07
| id | name | bytes (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. |
per-fact attribution:
agent: curl -H 'accept: application/json' wire.phall.io/terminal-osc/11
or /terminal-osc/11.json