fix(appearance): re-run compositor on auto theme switch#212
Merged
fabioluciano merged 1 commit intofabioluciano:mainfrom Mar 30, 2026
Merged
Conversation
When macOS appearance changed, only @powerkit_theme_variant was updated and the rendered segment cache was cleared. But status-format[0] and status-style are static strings generated at init time with hardcoded hex color values — they were never regenerated, so the session bar, windows, and surrounding chrome stayed in the previous theme. Re-run tmux-powerkit.tmux on theme switch so compose_layout() and configure_status_bar() regenerate all static tmux options with the correct theme colors. Also drop the now-redundant cache_clear_prefix call from both appearance.sh and appearance_toggle.sh — the render cache key includes the theme variant, so switching variants naturally routes to the correct (or absent) cache entry without manual clearing.
github-actions bot
pushed a commit
that referenced
this pull request
Mar 30, 2026
## [5.28.1](v5.28.0...v5.28.1) (2026-03-30) ### Bug Fixes * **appearance:** re-run compositor on auto theme switch ([#212](#212)) ([dd5cc14](dd5cc14))
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
When macOS appearance changed automatically (auto/schedule mode), the statusbar session block, window list, and surrounding chrome stayed in the previous theme's colors. Only the plugin segments (rendered dynamically via
#(powerkit-render right)) updated correctly.Root Cause
compose_layout()andconfigure_status_bar()bake theme hex color values intostatus-format[0]andstatus-styleas static strings at init time. When_appearance_switch_theme()fired on a macOS appearance change, it only:@powerkit_theme_variantrendered_right__*segment cacherefresh-client -SThe compositor was never re-run, so the hardcoded colors in
status-format[0](e.g.bg=#073642) remained from the previous theme.Fix
Re-run
tmux-powerkit.tmuxin the background after a theme switch, which triggerscompose_layout()andconfigure_status_bar()to regenerate all static tmux options with the correct theme colors.Also removes the now-redundant
cache_clear_prefix "rendered_right__"calls from bothappearance.shandappearance_toggle.sh. The render cache key includes the theme variant, so switching variants automatically routes to the correct cache entry — the old variant's cache file becomes an unreferenced orphan and is never served.Changes
src/plugins/appearance.sh: replacecache_clear_prefix+refresh-client -Swith background re-run oftmux-powerkit.tmuxsrc/helpers/appearance_toggle.sh: remove redundantcache_clear_prefix "rendered_right__"(toggle already calledtmux-powerkit.tmux)