Skip to content

Commit 1770048

Browse files
committed
docs(cli): reorganize theme detection docs as numbered priority list
1 parent b7fde72 commit 1770048

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

cli/README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,29 @@ codebuff-tui
7878

7979
## Theme Detection
8080

81-
The CLI auto‑detects light/dark mode using multiple sources with a clear precedence:
82-
83-
- Preferred: Terminal OSC 10/11 polling (background/foreground color)
84-
- Polled every 5s
85-
- Works in native terminals that answer OSC (Terminal.app, iTerm2, WezTerm, kitty, Alacritty, Ghostty)
86-
- Supports tmux/screen via passthrough wrapping
87-
- Fallback: IDE theme (when running in an integrated terminal)
88-
- VS Code family (Code/Cursor/VSCodium) via settings.json and env
89-
- JetBrains (IntelliJ family) via laf.xml and env
90-
- Zed via its settings and explicit env vars (e.g., `ZED_TERM`)
91-
- Last resort: OS/platform theme
92-
- macOS via `defaults read -g AppleInterfaceStyle`
93-
- Windows registry and common Linux desktop settings
94-
95-
Live updates
96-
97-
- Terminal OSC polling updates the theme automatically when the terminal changes its colors.
98-
- File watchers are enabled for IDE settings and macOS preference files, so theme changes propagate even when OSC is unavailable.
99-
- When both are available, OSC results take precedence over IDE/OS.
81+
The CLI auto-detects light/dark mode using multiple sources in order of priority:
82+
83+
1. **Terminal colors** (highest priority)
84+
- Detects via OSC 10/11 queries to terminal background/foreground colors
85+
- Updates within 5 seconds when terminal theme changes
86+
- Supports: Terminal.app, iTerm2, WezTerm, kitty, Alacritty, Ghostty
87+
- Works in tmux/screen via passthrough wrapping
88+
89+
2. **IDE theme** (when running in integrated terminal)
90+
- VS Code/Cursor/VSCodium: `settings.json` + `VSCODE_THEME_KIND` env var
91+
- JetBrains (IntelliJ, PyCharm, etc.): `laf.xml` + env vars
92+
- Zed: `settings.json` + `ZED_TERM` env var
93+
- Updates within ~250ms via file watchers
94+
95+
3. **OS/Platform theme** (fallback)
96+
- macOS: `defaults read -g AppleInterfaceStyle` + file watchers on `.GlobalPreferences.plist`, `com.apple.Terminal.plist`, `com.googlecode.iterm2.plist`
97+
- Windows: Registry keys for system theme
98+
- Linux: GTK theme, GNOME/KDE settings
99+
- Updates within ~250ms via file watchers (macOS)
100+
101+
4. **Default dark** (if all detection fails)
102+
103+
All detection methods run in parallel. Terminal colors take precedence when available
100104

101105
Manual refresh
102106

0 commit comments

Comments
 (0)