From f66ee4d845adfb6e394356078986d8bf313fc18c Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Thu, 6 Aug 2026 01:35:25 +0300 Subject: [PATCH] kitty: give active ssh tabs the same foreground as every other tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit __kitty_tab_set sent a luminance-picked black/white active_fg, so a tinted tab's title looked different from a normal one. Send NONE instead: tab_fg() then falls back to the shared active foreground (the theme background) while active_bg keeps the per-host tint. Covered by a new case in tests/test_tab_bar_colors.py matching what __kitty_tab_set actually sends — host background, no fg override. --- .../kitty/private_tests/private_test_tab_bar_colors.py | 7 +++++++ .../private_fish/functions/__kitty_tab_set.fish | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/private_dot_config/kitty/private_tests/private_test_tab_bar_colors.py b/private_dot_config/kitty/private_tests/private_test_tab_bar_colors.py index 8ecddac..ae91e78 100644 --- a/private_dot_config/kitty/private_tests/private_test_tab_bar_colors.py +++ b/private_dot_config/kitty/private_tests/private_test_tab_bar_colors.py @@ -99,6 +99,13 @@ for theme_bg in (0xF8F8F8, 0x1C2836): (as_rgb(HOST_FG), as_rgb(HOST_BG)), "active tab takes the host color", ), + ( + # What __kitty_tab_set actually sends: host background, no fg + # override, so the shared active foreground applies. + TabBarData("tab", is_active=True, active_bg=HOST_BG), + (as_rgb(theme_bg), as_rgb(HOST_BG)), + "active tab without an fg override keeps the shared foreground", + ), ( TabBarData("tab", is_active=False, inactive_fg=HOST_BG), (as_rgb(HOST_BG), as_rgb(theme_bg)), diff --git a/private_dot_config/private_fish/functions/__kitty_tab_set.fish b/private_dot_config/private_fish/functions/__kitty_tab_set.fish index 9fdbe62..08083c9 100644 --- a/private_dot_config/private_fish/functions/__kitty_tab_set.fish +++ b/private_dot_config/private_fish/functions/__kitty_tab_set.fish @@ -15,11 +15,11 @@ function __kitty_tab_set -d "Tint the current kitty tab for the given ssh/mosh h end end set -l bg (string split ' ' $colors)[1] - set -l fg (string split ' ' $colors)[2] - # Active tab: full host-color background, readable fg. + # Active tab: full host-color background, and NONE for the foreground so it + # falls back to the same one every other active tab uses. # Inactive tab: keep theme's dark background (NONE), host color as text only. - kitten @ set-tab-color "active_bg=$bg" "active_fg=$fg" \ + kitten @ set-tab-color "active_bg=$bg" active_fg=NONE \ "inactive_bg=NONE" "inactive_fg=$bg" 2>/dev/null kitten @ set-tab-title "$host" 2>/dev/null end