From b3b7d0596d0c3f81fe1d27accb23fe901fb0b4c3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 15 Mar 2026 09:20:33 +0530 Subject: [PATCH] Dont use neighboring tab colors for tab bar margins on translucent OS windows The colors are rendered semi-transparent which effectively means they blend with background unlike the neighboring colors and end up not matching --- docs/changelog.rst | 2 ++ kitty/options/definition.py | 4 +++- kitty/tab_bar.py | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d7a3cad79..a79b2b873 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -186,6 +186,8 @@ Detailed list of changes - macOS: Fix using Fn key for start dictation not working (:iss:`9661`) +- Don't use neighboring tab colors for tab bar margins in translucent windows (:iss:`9663`) + 0.46.0 [2026-03-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/options/definition.py b/kitty/options/definition.py index 35845be98..e037a17af 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -1795,7 +1795,9 @@ opt('tab_bar_margin_color', 'none', long_text=''' Color for the tab bar margin area. Defaults to using the terminal background color for margins above and below the tab bar. For side margins the default -color is chosen to match the background color of the neighboring tab. +color is chosen to match the background color of the neighboring tab, unless +the window is translucent, in which case the default background is used as it +looks better. ''') opt( diff --git a/kitty/tab_bar.py b/kitty/tab_bar.py index aaf96f598..d42da165b 100644 --- a/kitty/tab_bar.py +++ b/kitty/tab_bar.py @@ -19,6 +19,7 @@ from .fast_data_types import ( Color, Region, Screen, + background_opacity_of, cell_size_for_window, get_boss, get_options, @@ -695,7 +696,8 @@ class TabBar: blank_rects.append(Border(0, tab_bar.bottom, vw, central.top, bg)) g = self.window_geometry left_bg = right_bg = bg - if opts.tab_bar_margin_color is None and opts.tab_bar_margin_width > 0: + if opts.tab_bar_margin_color is None and ( + opacity := background_opacity_of(self.os_window_id)) is not None and opacity >= 1: left_bg = BorderColor.tab_bar_left_edge_color right_bg = BorderColor.tab_bar_right_edge_color if g.left > 0: