Skip to main content

Module theme

Module theme 

Source
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§

Theme

Functions§

handle_sync
shine theme sync [--auto] [--quiet]. Prints eval-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 a Theme using 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 a Theme. Any other value — including case variants — is rejected: SHINE_TERMINAL_THEME is 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 ssh remote session (PRD §6.1): prefers an already-exported SHINE_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). Returns None rather than failing shine ssh itself: this is a display-layer nicety, never a reason to block a login.