Expand description
OSC 11 terminal-background-colour detection.
Queries the active terminal for its background colour and decides
light vs. dark. Used at startup when Config::ui.theme == Auto to
pick the right colour palette. On terminals that don’t respond
(macOS Terminal.app, Windows conhost), returns None and the
caller falls back to the legacy dark palette.
Must be called with raw mode active — otherwise the response is line-buffered by the kernel and never reaches us within the timeout.
Functions§
- detect_
light - Query the terminal for its background colour and decide light vs.
dark. Returns
Some(true)for light,Some(false)for dark,Nonewhen the terminal didn’t respond withintimeout.