diff --git a/docs/changelog.rst b/docs/changelog.rst index d30279b52..84b0c712f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -101,6 +101,8 @@ Detailed list of changes - diff kitten: Add half page and full page scroll vim-like bindings (:pull:`8514`) +- Fix a regression that caused automatic color themes to not be re-applied after config file reload (:iss:`8530`) + 0.41.1 [2025-04-03] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/boss.py b/kitty/boss.py index f7f92f60e..6435210e7 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -2695,8 +2695,10 @@ class Boss: for tm in self.all_tab_managers: tm.apply_options() # Update colors - if theme_colors.applied_theme and theme_colors.refresh(): - theme_colors.apply_theme(theme_colors.applied_theme, notify_on_bg_change=False) + if theme_colors.has_applied_theme: + theme_colors.refresh() + if theme_colors.has_applied_theme: # in case the theme file was deleted + theme_colors.apply_theme(theme_colors.applied_theme, notify_on_bg_change=False) for w in self.all_windows: if w.screen.color_profile.default_bg != bg_colors_before.get(w.id): self.default_bg_changed_for(w.id) diff --git a/kitty/colors.py b/kitty/colors.py index ec0e8a0de..1db4e524f 100644 --- a/kitty/colors.py +++ b/kitty/colors.py @@ -83,6 +83,18 @@ class ThemeColors: found = True return found + @property + def has_applied_theme(self) -> bool: + match self.applied_theme: + case '': + return False + case 'dark': + return self.has_dark_theme + case 'light': + return self.has_light_theme + case 'no_preference': + return self.has_no_preference_theme + @property def has_dark_theme(self) -> bool: return self.dark_mtime > -1