fix(theme-cycler): persist theme selection to settings.json#25
Open
malammar wants to merge 2 commits into
Open
fix(theme-cycler): persist theme selection to settings.json#25malammar wants to merge 2 commits into
malammar wants to merge 2 commits into
Conversation
…ssion_start The previous fix persisted theme changes correctly but they still reverted on reload because all extensions call applyExtensionDefaults on session_start, and the last one to fire would overwrite the restored theme. Fix at the source: applyExtensionTheme() in themeMap.ts now checks settings.json first and honours the saved preference over themeMap defaults. This makes ALL extensions respect the user's saved theme automatically, with no timing hacks or per-extension workarounds needed.
jetnet
pushed a commit
to jetnet/pi-coms
that referenced
this pull request
May 23, 2026
Add persistTheme() helper that writes theme name to ~/.pi/agent/settings.json after every setTheme() call: - cycleTheme() — Ctrl+X / Ctrl+Q - /theme <name> — direct set - /theme — select picker Addresses PR disler#25.
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.
Problem
theme-cycler.tscallsctx.ui.setTheme()to switch themes at runtime but never writes the selection back tosettings.json. This means any theme switched via/theme,Ctrl+X, orCtrl+Qis lost on restart — pi always reverts to whatever"theme"was last set insettings.json.Fix
Added a
persistTheme()helper that writes the selected theme name to~/.pi/agent/settings.jsonafter everyctx.ui.setTheme()call. This mirrors how pi's own/settingscommand persists the theme.Called after all 3 occurrences of
ctx.ui.setTheme()in the file:cycleTheme()— Ctrl+X / Ctrl+Q/theme <name>direct set/themeselect pickerTesting
-e extensions/theme-cycler.ts/themeand select any theme