diff --git a/docs/changelog.rst b/docs/changelog.rst index 799dbc3e5..2669aed6b 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -161,6 +161,8 @@ Detailed list of changes - :ac:`goto_session`: allow specifying a directory to select a session file from the directory (:pull:`9219`) +- Have reloading config also reload the custom tab bar python modules (:disc:`9221`) + 0.44.0 [2025-11-03] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/boss.py b/kitty/boss.py index b275946d6..5dbcee872 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -2938,6 +2938,8 @@ class Boss: from .guess_mime_type import clear_mime_cache clear_mime_cache() store_effective_config() + from .tab_bar import clear_caches + clear_caches() def safe_delete_temp_file(self, path: str) -> None: if is_path_in_temp_dir(path): diff --git a/kitty/tab_bar.py b/kitty/tab_bar.py index 07ced098b..ea9531f9d 100644 --- a/kitty/tab_bar.py +++ b/kitty/tab_bar.py @@ -523,6 +523,11 @@ def load_custom_draw_tab() -> DrawTabFunc: return draw_tab +def clear_caches() -> None: + load_custom_draw_tab.clear_cached() + load_custom_draw_tab_module.clear_cached() + + class CustomDrawTitleFunc: def __init__(self, data: dict[str, Any], implementation: Callable[[dict[str, Any]], str] | None = None):