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
This commit is contained in:
Kovid Goyal 2026-03-15 09:20:33 +05:30
parent b93f1badd1
commit b3b7d0596d
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
3 changed files with 8 additions and 2 deletions

View file

@ -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]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -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(

View file

@ -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: