From 700a74eb56decddbb7a45bd7a16688a63e2f490c Mon Sep 17 00:00:00 2001 From: Alex Oprisan Date: Wed, 11 Feb 2026 16:59:59 +0200 Subject: [PATCH] Fix vertical tab bar status/layout regressions - align split drag hitboxes with left vertical tab bar offset - use effective fancy mode for tab-bar state formatting when vertical - fix command palette centering with left vertical tab bar --- wezterm-gui/src/tabbar.rs | 27 ++++++++++++++-------- wezterm-gui/src/termwindow/palette.rs | 3 +-- wezterm-gui/src/termwindow/render/split.rs | 2 ++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/wezterm-gui/src/tabbar.rs b/wezterm-gui/src/tabbar.rs index a6dbbbd2c..467cac1ae 100644 --- a/wezterm-gui/src/tabbar.rs +++ b/wezterm-gui/src/tabbar.rs @@ -224,7 +224,11 @@ fn compute_tab_title( tab.tab_title.clone() }; - let classic_spacing = if config.use_fancy_tab_bar { "" } else { " " }; + let classic_spacing = if effective_use_fancy_tab_bar(config) { + "" + } else { + " " + }; if config.show_tab_index_in_tab_bar { let index = format!( "{classic_spacing}{}: ", @@ -274,7 +278,7 @@ fn compute_tab_title( // easier to click on tab titles, but we'll still go below // this if there are too many tabs to fit the window at // this width. - if !config.use_fancy_tab_bar { + if !effective_use_fancy_tab_bar(config) { while len + unicode_column_width(&title, None) < 5 { title.push(' '); } @@ -303,6 +307,10 @@ fn is_tab_hover(mouse_x: Option, x: usize, tab_title_len: usize) -> bool .unwrap_or(false); } +fn effective_use_fancy_tab_bar(config: &ConfigHandle) -> bool { + config.use_fancy_tab_bar || config.resolved_tab_bar_position().is_vertical() +} + impl TabBarState { pub fn default() -> Self { Self { @@ -337,13 +345,13 @@ impl TabBarState { line: &mut Line, colors: &TabBarColors, ) { - let default_cell = if config.use_fancy_tab_bar { + let default_cell = if effective_use_fancy_tab_bar(config) { CellAttributes::default() } else { colors.new_tab().as_cell_attributes() }; - let default_cell_hover = if config.use_fancy_tab_bar { + let default_cell_hover = if effective_use_fancy_tab_bar(config) { CellAttributes::default() } else { colors.new_tab_hover().as_cell_attributes() @@ -440,7 +448,7 @@ impl TabBarState { let new_tab = parse_status_text( &config.tab_bar_style.new_tab, - if config.use_fancy_tab_bar { + if effective_use_fancy_tab_bar(config) { CellAttributes::default() } else { new_tab_attrs.clone() @@ -448,7 +456,7 @@ impl TabBarState { ); let new_tab_hover = parse_status_text( &config.tab_bar_style.new_tab_hover, - if config.use_fancy_tab_bar { + if effective_use_fancy_tab_bar(config) { CellAttributes::default() } else { new_tab_hover_attrs.clone() @@ -492,7 +500,8 @@ impl TabBarState { let available_cells = title_width.saturating_sub(number_of_tabs.saturating_sub(1) + new_tab.len()); - let tab_width_max = if config.use_fancy_tab_bar || available_cells >= titles_len { + let tab_width_max = if effective_use_fancy_tab_bar(config) || available_cells >= titles_len + { // We can render each title with its full width usize::max_value() } else { @@ -515,7 +524,7 @@ impl TabBarState { if use_integrated_title_buttons && config.integrated_title_button_style == IntegratedTitleButtonStyle::MacOsNative - && config.use_fancy_tab_bar == false + && !effective_use_fancy_tab_bar(config) && config.resolved_tab_bar_position() == TabBarPosition::Top { for _ in 0..10 as usize { @@ -574,7 +583,7 @@ impl TabBarState { let esc = format_as_escapes(tab_title.items.clone()).expect("already parsed ok above"); let mut tab_line = parse_status_text( &esc, - if config.use_fancy_tab_bar { + if effective_use_fancy_tab_bar(config) { CellAttributes::default() } else { cell_attrs.clone() diff --git a/wezterm-gui/src/termwindow/palette.rs b/wezterm-gui/src/termwindow/palette.rs index 907040f1a..6a15714a4 100644 --- a/wezterm-gui/src/termwindow/palette.rs +++ b/wezterm-gui/src/termwindow/palette.rs @@ -516,8 +516,7 @@ impl CommandPalette { })) .min_width(Some(Dimension::Pixels(desired_pixel_width))); - let x_adjust = - ((avail_pixel_width - padding_left - left_bar_width) - desired_pixel_width) / 2.; + let x_adjust = ((avail_pixel_width - padding_left) - desired_pixel_width) / 2.; let computed = term_window.compute_element( &LayoutContext { diff --git a/wezterm-gui/src/termwindow/render/split.rs b/wezterm-gui/src/termwindow/render/split.rs index b4ed51a6e..3713840e6 100644 --- a/wezterm-gui/src/termwindow/render/split.rs +++ b/wezterm-gui/src/termwindow/render/split.rs @@ -53,6 +53,7 @@ impl crate::TermWindow { self.ui_items.push(UIItem { x: border.left.get() as usize + padding_left as usize + + left_bar_offset as usize + (split.left * cell_width as usize), width: cell_width as usize, y: padding_top as usize @@ -76,6 +77,7 @@ impl crate::TermWindow { self.ui_items.push(UIItem { x: border.left.get() as usize + padding_left as usize + + left_bar_offset as usize + (split.left * cell_width as usize), width: split.size * cell_width as usize, y: padding_top as usize -- 2.51.2