wire / terminal-osc / 21

OSC 21 — Color scheme (dark/light) notification

OSC 21 is sent by the terminal to report color scheme changes: OSC 21 ; dark ST or OSC 21 ; light ST. Applications can query with OSC 21 ; ? ST.

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

aka: OSC 21 · OSC 21 — Color scheme (dark/light) notification

frame

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

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

parameters / subcommands

idnamebytes (ST)meaning
dark Dark mode \x1b]21;dark\x1b\ OSC 21 ; dark ST reports dark mode.
light Light mode \x1b]21;light\x1b\ OSC 21 ; light ST reports light mode.
query Query scheme \x1b]21;?\x1b\ OSC 21 ; ? ST queries the current color scheme.

gotchas


provenance

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