Skip to content

feat(tui): add theme_mode config to override terminal color detection#15612

Open
Br1an67 wants to merge 1 commit intoanomalyco:devfrom
Br1an67:fix/issue-4464-theme-mode-override
Open

feat(tui): add theme_mode config to override terminal color detection#15612
Br1an67 wants to merge 1 commit intoanomalyco:devfrom
Br1an67:fix/issue-4464-theme-mode-override

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Issue for this PR

Closes #4464

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a theme_mode config option to tui.json that 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 their tui.json to force light mode. Valid values are "light", "dark", or "system" (default, auto-detect).

Two files changed:

  • config/tui-schema.ts — added theme_mode enum field to TuiInfo
  • tui/context/theme.tsxconfigMode() helper reads the override; applied at init and reactively via createEffect

How did you verify your code works?

Reviewed the existing theme init flow: getTerminalBackgroundColor() returns the detected mode, ThemeProvider receives it as props, and the store initializes from it. The configMode() override takes priority over both terminal detection and the persisted KV value when set to light or dark.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

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
#15089

Why it might be related:

I'd recommend checking PR #15089 to see if it already implements the theme_mode configuration or if there's potential for consolidation or conflicts between the two implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG/FEATURE] Light Mode doesn't work in Zellij

1 participant