You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Themes always render light variant on macOS regardless of terminal dark background (OSC 11 detection broken) #23196
Since April 17, 2026, OpenCode renders the light variant of all themes regardless of the terminal's actual background color. The dark variant never loads. This happens across multiple terminals on macOS.
This appears to be related to OC-13047, OC-11441, and OC-12486 but with a broader scope — it is not limited to one terminal or theme.
If your issue is distinct from these, please add details explaining what differs. Otherwise, consider adding a +1 or additional context to one of the existing issues.
I noticed solarized light becoming dark in wezterm. My theme is light and opencode was also light. After todays update, opencode turned dark with same setting.
I'm having the same issue on ghostty + macOS regardless if I'm using tmux or not. Commented in #20926.
@kommander If it helps, I attempted ctrl+p and then "unlock theme mode" with no visible changes. Attempted to restart opencode and then also tried restarting ghostly as well with no change after toggling that option. Behavior is still present. This seems to have only started occurring in the 1.14.19 release. 1.14.18 and lower work fine when this was fixed a few weeks ago originally.
Adding another reproducible macOS + Ghostty report.
On this machine:
OpenCode 1.14.20
Ghostty on macOS with theme = light:Catppuccin Latte,dark:Catppuccin Mocha and window-theme = auto
OpenCode TUI config set to theme: "github" in ~/.config/opencode/tui.json
I removed all persisted mode overrides from ~/.local/state/opencode/kv.json, so it now only contains theme: "github":
no theme_mode_lock
no theme_mode
Unlock theme mode had no effect.
Behavior I am still seeing:
Set macOS to dark mode
Ghostty switches to dark correctly
Fully quit OpenCode
Reopen OpenCode
OpenCode still renders the light variant
I also tested theme: "system" and it still did not follow correctly, so this does not look specific to the github theme itself.
This seems consistent with the CSI 996 / OSC 11 mismatch discussed above: startup mode detection still appears wrong even after removing the lock/cache state.
So Ghostty itself is returning the expected mode/colors.
But OpenCode is still wrong:
in macOS light mode, OpenCode command palette shows Lock theme mode and Switch to light mode
after switching macOS to dark mode, OpenCode still shows Lock theme mode and Switch to light mode
That means OpenCode believes its current mode is already dark in both cases, even though the terminal probe in the same tab reports light and dark correctly.
So on this machine the issue seems narrower than "Ghostty reports the wrong theme":
terminal probe outside OpenCode is correct
no persisted theme lock/cache is present
OpenCode 1.14.20 still starts/behaves as if mode is stuck on dark
@coygeek - I'm not using the dynamic switcher and am rather modifying my config file to point to a light or dark theme. Like I said I'm happy to provide more info to help you reproduce the issue!
I can confirm @Klassikcat's suggested fix works on light and dark mode.
Activity
github-actions commentedon Apr 17, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from these, please add details explaining what differs. Otherwise, consider adding a
+1or additional context to one of the existing issues.victoralensai commentedon Apr 20, 2026
same issue with ghostty on Arch Linux version on opencode 1.14.19
wKich commentedon Apr 20, 2026
Interesting, until 1.14.19 I used to had correct theme rendering in macos in Ghostty.
klement commentedon Apr 20, 2026
I noticed solarized light becoming dark in wezterm. My theme is light and opencode was also light. After todays update, opencode turned dark with same setting.
wKich commentedon Apr 20, 2026
It looks like #23188 this PR might be related to how theme become inverted in 1.14.19 release
wKich commentedon Apr 20, 2026
@kommander, could you please check if my suggestion is correct? In iTerm opencode renders in correct theme, so maybe it's only Ghostty issue
klement commentedon Apr 20, 2026
@wKich I’m using wezterm and seeing the same (on macos)
joaomj commentedon Apr 20, 2026
same here (ghostty + ubuntu). Worked fine in 1.14.18
kommander commentedon Apr 20, 2026
Can you try ctrl+p and then "Unlock theme mode"?
WolffTech commentedon Apr 20, 2026
I'm having the same issue on ghostty + macOS regardless if I'm using tmux or not. Commented in #20926.
@kommander If it helps, I attempted ctrl+p and then "unlock theme mode" with no visible changes. Attempted to restart opencode and then also tried restarting ghostly as well with no change after toggling that option. Behavior is still present. This seems to have only started occurring in the 1.14.19 release. 1.14.18 and lower work fine when this was fixed a few weeks ago originally.
klement commentedon Apr 20, 2026
Mine is
and I am experiencing this issue, [un]lock theme mode doesn’t do anything.
5 remaining items
coygeek commentedon Apr 22, 2026
Adding another reproducible macOS + Ghostty report.
On this machine:
1.14.20theme = light:Catppuccin Latte,dark:Catppuccin Mochaandwindow-theme = autotheme: "github"in~/.config/opencode/tui.jsonI removed all persisted mode overrides from
~/.local/state/opencode/kv.json, so it now only containstheme: "github":theme_mode_locktheme_modeUnlock theme modehad no effect.Behavior I am still seeing:
I also tested
theme: "system"and it still did not follow correctly, so this does not look specific to thegithubtheme itself.This seems consistent with the
CSI 996/OSC 11mismatch discussed above: startup mode detection still appears wrong even after removing the lock/cache state.coygeek commentedon Apr 22, 2026
Adding a stronger repro/data point here. This is not just a stale lock/cache issue on my machine.
Environment:
1.14.20theme = light:Catppuccin Latte,dark:Catppuccin Mochawindow-theme = autogithubMy persisted OpenCode state is clean:
~/.config/opencode/tui.jsoncontains onlytheme: "github"~/.local/state/opencode/kv.jsoncontains onlytheme: "github"theme_mode_locktheme_modeI ran the maintainer probe script directly in the same Ghostty tab where I launch
opencode.In macOS light mode, Ghostty reports light correctly:
In macOS dark mode, Ghostty reports dark correctly:
So Ghostty itself is returning the expected mode/colors.
But OpenCode is still wrong:
Lock theme modeandSwitch to light modeLock theme modeandSwitch to light modeThat means OpenCode believes its current mode is already
darkin both cases, even though the terminal probe in the same tab reportslightanddarkcorrectly.So on this machine the issue seems narrower than "Ghostty reports the wrong theme":
1.14.20still starts/behaves as if mode is stuck ondarkKlassikcat commentedon Apr 23, 2026
Seems like related to this code block i guess:
coygeek commentedon Apr 23, 2026
Fixed in v1.14.20
Tested on 2 macs, works normally now.
coygeek commentedon Apr 23, 2026
@jepachecoam consider closing
pearofducks commentedon Apr 23, 2026
@coygeek
I'm seeing it always detect dark mode now instead (as in, even when the terminal is light). Happy to provide input.
I guess this specific issue could be closed, but it seems like the root problem is ongoing?
coygeek commentedon Apr 23, 2026
I see this in dark mode (aka macos dark mode) which matches my opencode dark mode:
I see this in light mode (aka macos light mode) which matches my opencode light mode:
tui.json:
Looks normal to me. Using Ghostty, not terminal.
Klassikcat commentedon Apr 23, 2026
@pearofducks
Quick fix:
packages/opencode/src/cli/cmd/tui/util/terminal.tsline22from:
to:
OPENCODE_VERSION=1.14.20 npx -y bun@1.3.11 run --cwd packages/opencode build --singleto build.cp $HOME/path/to/opencode/packages/opencode/dist/opencode-linux-x64/bin/opencode" "$HOME/.opencode/bin/opencode"Tested on Ubuntu 24.04, hyprland WM, terminal emulator: kitty and warp terminal.
pearofducks commentedon Apr 23, 2026
@coygeek - I'm not using the dynamic switcher and am rather modifying my config file to point to a light or dark theme. Like I said I'm happy to provide more info to help you reproduce the issue!
I can confirm @Klassikcat's suggested fix works on light and dark mode.
(I had to build using
1.3.13of Bun instead)github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.