Expand description
shine theme sync: resolves the terminal’s light/dark theme and prints
shell-safe export statements for SHINE_TERMINAL_THEME and BAT_THEME.
See docs/terminal-theme-sync-prd.md for the full design and
docs/kb/lessons.md (2026-07-14) for why the old shell-only OSC read loop
was replaced.
Enums§
Functions§
- handle_
sync shine theme sync [--auto] [--quiet]. Printseval-able shell export statements to stdout; diagnostics go to stderr (suppressed by--quiet). Always exits successfully — an unresolved theme prints nothing rather than failing, so an old/broken binary or an unsupported terminal never blocks shell startup (PRD §7).- parse_
colorfgbg - Parses
COLORFGBG("fg;bg", or"fg;dark_bg;bg"on some terminals — only the last field is ever the background) into aThemeusing the conventional xterm 16-color palette: indices 0-6 and 8 are dark, 7 and 9-15 are light. - parse_
theme_ str - Parses
value("light"or"dark") as aTheme. Any other value — including case variants — is rejected:SHINE_TERMINAL_THEMEis a display-only signal (PRD §10), not something to interpret loosely. - resolve_
local_ terminal_ theme_ for_ injection - Resolves the local terminal’s theme for injection into a
shine sshremote session (PRD §6.1): prefers an already-exportedSHINE_TERMINAL_THEME, otherwise queries the local tty directly — unlike a remote query, this is a same-host round trip with no fragmentation risk (PRD §2.2). ReturnsNonerather than failingshine sshitself: this is a display-layer nicety, never a reason to block a login.