Repository navigation
fix(terminal): scope terminal color overrides to their light/dark theme slot - #36581
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Oct 31, 2026
This was referenced Oct 31, 2026
This was referenced Nov 2, 2026
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.
Summary
Terminal Color Overrides now belong to a terminal theme slot (Dark / Light), the same way the theme picker and divider color already do. Setting a dark background override no longer repaints the light terminal.
Root cause:
terminalColorOverrideswas one bag that every reader spread over whatever theme was active. That happened in six places: xterm panes, the OSC 10/11 replies (desktop, headlessorca serve) and native chat, the left sidebar's Match Terminal, the mobile terminal theme, and the pane title projection.Fix:
terminalColorOverridesstays as the dark slot's bag, and a newterminalColorOverridesLightholds the light slot's. The light bag is used only when light mode has its own terminal theme; when light matches dark, light mode keeps using the dark slot.resolveTerminalPalette(shared/terminal-theme-selection.ts) returns the slot's theme with its overrides already painted on.resolveEffectiveTerminalAppearanceandresolveConfiguredTerminalColors(OSC 10/11 and chat) both use it, so every downstream reader gets the right colors. All six copies of the override spreading are deleted. The deadappearance.theme ?? getBuiltinTheme(...)fallbacks are gone too, because the resolver already falls back to the slot's default theme.undefineduntil reload) no longer blanks the theme's color. The settings preview memo now re-derives when either bag changes.Migration is a one-shot step in the desktop/
orca serveprofile load and in the web client's localStorage load, guarded by a stamp so it never runs twice.Mixed versions:
terminalColorOverrides, so it shows the dark slot's colors in both modes. That is the old behavior, and nothing is lost.orca serve: it answers OSC 10/11 through the same resolver.Builds on #10581 by @innocarpe, who first scoped the overrides per mode and spotted that light mode matching dark must reuse the dark bag. This PR differs in three ways:
modethrough every caller.Closes #10561
Supersedes #10581
Visual proof
The test profile has a dark-slot override (background
#3b0d1f, foreground#ffd6e0) and a separate light theme.Before (origin/main), app in light mode: the dark override still paints the light terminal, and the editor is one shared bag.
After, dark mode: the dark slot's override applies, and the editor is labelled for the dark theme.
After, light mode: the light slot starts empty. A light background typed into the editor on the Light target shows in the preview and the live terminal, and the dark slot is unchanged.
Merge-risk assessment
Low. It was "low to medium" before I exercised the risky paths on real installs. The settings were read straight from the persisted
profile-state.dbwithnode:sqlite, not just from the in-memory store.#3b0d1f/#ffd6e0), app onsystem, separate light theme. The database holds onlyterminalColorOverrides.terminalColorOverridesLight, andterminalColorOverridesSplit: true. The terminal looks the same as before the upgrade.#fff4d6. The dark bag was untouched.terminalColorOverrides = #0d3b1f), then upgraded to the branch again. There was no re-migration: dark mode paints#0d3b1f, light mode keeps#fff4d6.orca serve(headless serve on Linuxopenclaw, desktop client on Windowsawin, paired over LAN, remote bash terminal, client app in light mode with dark bag#3b0d1fand light bag#fff4d6):rgb:3b3b/0d0d/1f1f. That is the old client's dark-everywhere color, matching what it paints.rgb:ffff/f4f4/d6d6. That is the light slot, matching the light terminal.Negative user-facing tradeoffs
Validation
pnpm tc,oxlintandoxfmton all changed files.pnpm teston 105 related files: 939 passing. Coverage includes:terminalColorOverridesLightwhile the dark bag stays unchangedorca servein both directions with OSC 11 replies (see the merge-risk section).