feat(tui): add theme_mode config to override terminal color detection#15612
Open
Br1an67 wants to merge 1 commit intoanomalyco:devfrom
Open
feat(tui): add theme_mode config to override terminal color detection#15612Br1an67 wants to merge 1 commit intoanomalyco:devfrom
Br1an67 wants to merge 1 commit intoanomalyco:devfrom
Conversation
Terminals like Zellij misreport system theme, making the TUI render
in dark mode even when the terminal is light. Add a theme_mode option
('light' | 'dark' | 'system') to tui.json that overrides terminal
background color detection when set to light or dark.
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found a potentially related PR: Related PR:PR #15089: feat(tui): add Mode 2031 theme detection with tri-state appearance mode Why it might be related:
I'd recommend checking PR #15089 to see if it already implements the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #4464
Type of change
What does this PR do?
Adds a
theme_modeconfig option totui.jsonthat lets users override terminal color scheme detection. Zellij (and some other terminals) misreport the system theme, causing opencode to always render in dark mode.Users can now set
"theme_mode": "light"in theirtui.jsonto force light mode. Valid values are"light","dark", or"system"(default, auto-detect).Two files changed:
config/tui-schema.ts— addedtheme_modeenum field toTuiInfotui/context/theme.tsx—configMode()helper reads the override; applied at init and reactively viacreateEffectHow did you verify your code works?
Reviewed the existing theme init flow:
getTerminalBackgroundColor()returns the detected mode,ThemeProviderreceives it as props, and the store initializes from it. TheconfigMode()override takes priority over both terminal detection and the persisted KV value when set tolightordark.Checklist