Skip to content

Commit 2b4108b

Browse files
fawolfmannclaude
andcommitted
Add a distinct sidebar panel background for vertical tab bars
Builds on top of kovidgoyal#9855 (vertical tab bars on left/right). When tab_bar_edge is left or right and tab_bar_background is unset, derive a panel colour from the theme (window background blended towards the foreground) so the sidebar reads as a distinct panel rather than blending into the window content. Overridable by setting tab_bar_background explicitly. Also fill the area around the cell grid with the tab bar background instead of the terminal background, so the panel stays one uniform colour to the edges (no seam below/around the tabs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8d93548 commit 2b4108b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

kitty/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,13 @@ def finalize_mouse_mappings(opts: Options, accumulate_bad_lines: list[BadLine] |
141141
opts.mousemap = mousemap
142142

143143

144+
def finalize_tab_bar(opts: Options) -> None:
145+
from .fast_data_types import LEFT_EDGE, RIGHT_EDGE
146+
if opts.tab_bar_background is None and opts.tab_bar_edge in (LEFT_EDGE, RIGHT_EDGE):
147+
from .rgb import alpha_blend
148+
opts.tab_bar_background = alpha_blend(opts.foreground, opts.background, 0.12)
149+
150+
144151
def parse_config(
145152
lines: Iterable[str], accumulate_bad_lines: list[BadLine] | None = None, effective_config_lines: Callable[[str, str], None] | None = None
146153
) -> dict[str, Any]:
@@ -179,6 +186,7 @@ def add_effective_config_line(key: str, line: str) -> None:
179186
opts.alias_map.update(build_action_aliases(opts.action_alias))
180187
finalize_keys(opts, accumulate_bad_lines)
181188
finalize_mouse_mappings(opts, accumulate_bad_lines)
189+
finalize_tab_bar(opts)
182190
# delete no longer needed definitions, replacing with empty placeholders
183191
opts.kitten_alias = {}
184192
opts.action_alias = {}

kitty/tab_bar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,8 @@ def update_blank_rects(self, central: Region, tab_bar: Region, vw: int, vh: int)
730730
opts = get_options()
731731
blank_rects: list[Border] = []
732732
bg = BorderColor.tab_bar_margin_color if opts.tab_bar_margin_color is not None else BorderColor.default_bg
733+
if self.is_vertical and opts.tab_bar_margin_color is None and opts.tab_bar_background:
734+
bg = BorderColor.tab_bar_bg
733735
if opts.tab_bar_margin_height:
734736
if self.is_vertical:
735737
if opts.tab_bar_edge == LEFT_EDGE:

0 commit comments

Comments
 (0)