Add cross-platform terminal dark/light mode detection using the Mode 2031 VT extension (DECSET 2031). On startup, query the terminal's current appearance with CSI ? 996 n, then subscribe to live appearance change notifications with CSI ? 2031 h. When the OS or terminal switches between dark and light mode, the terminal sends a DSR that triggers an automatic theme re-evaluation. Previously, detectTerminalBackground() only checked the COLORFGBG environment variable once at launch — a static value that never updates when the system appearance changes mid-session. The SIGWINCH listener only fires on terminal resize, not on appearance changes. Mode 2031 is supported by Ghostty, Kitty (0.38.1+), Contour (0.4.0+), VTE/GNOME Terminal (0.82.0+), and tmux (3.6+). Unsupported terminals silently ignore the escape sequences and fall back to the existing COLORFGBG heuristic.
@oh-my-pi/pi-coding-agent
Core implementation package for the omp coding agent in the oh-my-pi monorepo.
For installation, setup, provider configuration, model roles, slash commands, and full CLI reference, see:
Package-specific references: