fix(terminal): new terminals respect selected color scheme#3343
Merged
gregpriday merged 3 commits intodevelopfrom Mar 16, 2026
Merged
fix(terminal): new terminals respect selected color scheme#3343gregpriday merged 3 commits intodevelopfrom
gregpriday merged 3 commits intodevelopfrom
Conversation
…nces - Read useTerminalColorSchemeStore.getState().getEffectiveTheme() in addTerminal() prewarm block - Add selectedSchemeId and customSchemes as deps in XtermAdapter terminalOptions memo - Pass theme to getXtermOptions() in TerminalRegistryController.prewarm() for consistency
- Export selectEffectiveTheme from terminalColorSchemeStore for direct subscription - Replace selectedSchemeId/customSchemes deps with effectiveTheme in XtermAdapter memo - Eliminates getState() call inside useMemo, fixing react-hooks/exhaustive-deps warning
- Extract computeEffectiveTheme helper shared by selectEffectiveTheme and getEffectiveTheme - Eliminates logic duplication and future drift risk
Collaborator
Author
|
Review status: Ready Clean refactor of Cross-PR note: This PR must merge before PR #3345 (match terminal scheme to app theme). Both modify |
This was referenced Mar 16, 2026
Merged
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
TerminalRegistryController.prewarm()and theXtermAdapterterminalOptionsmemo calledgetXtermOptions()without athemeargument, falling back togetTerminalThemeFromCSS()selectEffectiveThemeselector toterminalColorSchemeStoreand passes the resolved theme at construction time in both code pathsResolves #3335
Changes
src/store/terminalColorSchemeStore.ts— addsselectEffectiveThemeselector and agetEffectiveTheme()snapshot helper for use outside React; deduplicates the theme computation that was previously inlined in two placessrc/controllers/TerminalRegistryController.ts— readsgetEffectiveTheme()from the store snapshot when building xterm options for pre-warmed terminalssrc/components/Terminal/XtermAdapter.tsx— subscribes toselectEffectiveThemein theterminalOptionsmemo so new instances created during React mount use the current schemesrc/store/slices/terminalRegistry/index.ts— passesgetEffectiveTheme()when creating terminal instances inline (non-pool path)Testing
npm run checkpasses (typecheck, lint, format all clean)applyGlobalOptionsinuseTerminalConfig