Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

fix(gui): fit sidebar hover and pane clipping to a hiding tab row

RoversXc895f0fce23e
diff --git a/wezterm-gui/src/termwindow/render/pane.rs b/wezterm-gui/src/termwindow/render/pane.rs
index ed6563ae..76e34279 100644
--- a/wezterm-gui/src/termwindow/render/pane.rs
+++ b/wezterm-gui/src/termwindow/render/pane.rs
@@ -2326,14 +2326,18 @@ impl crate::TermWindow {
} else {
0
};
+ // Cut at the pane area's bottom too: a window tab row brought down
+ // pushes the rows lower, and the last of them go under a terminal
+ // bar at the bottom rather than through it.
let pane_clip = QuadClipRect::from_top_left_pixels(
left_pixel_x,
content_top,
left_pixel_x
+ render_dims.cols as f32 * pane_render_metrics.cell_size.width as f32,
- pane_top_pixel_y
+ (pane_top_pixel_y
+ render_dims.viewport_rows as f32
- * pane_render_metrics.cell_size.height as f32,
+ * pane_render_metrics.cell_size.height as f32)
+ .min(self.pane_area_bottom()),
&self.dimensions,
);
let mut render = LineRender {
diff --git a/wezterm-gui/src/termwindow/ui/right_sidebar.rs b/wezterm-gui/src/termwindow/ui/right_sidebar.rs
index 9e274e43..acf96e95 100644
--- a/wezterm-gui/src/termwindow/ui/right_sidebar.rs
+++ b/wezterm-gui/src/termwindow/ui/right_sidebar.rs
@@ -2507,10 +2507,11 @@ impl crate::TermWindow {
/// The right-edge strip that arms a hover reveal, as (x, y, w, h) in
/// window pixels. Computed against the docked rect so it exists while the
/// panel does not; like the left one it leaves out the tab bar row, where
- /// the pointer is on its way to the tabs or the sidebar button.
+ /// the pointer is on its way to the tabs or the sidebar button -- as much
+ /// of the row as is out, when it hides.
pub(crate) fn right_sidebar_hover_hot_zone(&self) -> Option<(usize, usize, usize, usize)> {
let rect = self.right_sidebar_rect_for_width(self.right_sidebar_docked_width())?;
- let top_tab_bar_height = self.tab_bar_pixel_height().unwrap_or(0.0).ceil() as usize;
+ let top_tab_bar_height = self.window_tab_row_drawn_height().ceil() as usize;
let width = self.ui_px(crate::termwindow::ui::tokens::SIDEBAR_HOVER_HOT_ZONE_WIDTH);
let right_edge = rect.x.saturating_add(rect.width);
crate::termwindow::sidebar_hover::hot_zone(
@@ -8415,9 +8416,10 @@ impl crate::TermWindow {
let mut rect = self.right_sidebar_rect_for_width(self.right_sidebar_presented_width())?;
// Off macOS the panel has no toggle of its own and the tab bar keeps
// the window buttons at its right end; a hover-revealed panel stays
- // below the tab bar so both remain reachable.
+ // below the tab bar so both remain reachable -- below as much of it
+ // as is out, when it hides.
if !cfg!(target_os = "macos") && self.right_sidebar_collapsed {
- let tab_bar = self.tab_bar_pixel_height().unwrap_or(0.0).ceil() as usize;
+ let tab_bar = self.window_tab_row_drawn_height().ceil() as usize;
let top = rect.y.saturating_add(tab_bar);
rect.height = rect.height.saturating_sub(top - rect.y);
rect.y = top;
diff --git a/wezterm-gui/src/termwindow/ui/sidebar.rs b/wezterm-gui/src/termwindow/ui/sidebar.rs
index f8c93269..b9ec8ec3 100644
--- a/wezterm-gui/src/termwindow/ui/sidebar.rs
+++ b/wezterm-gui/src/termwindow/ui/sidebar.rs
@@ -392,7 +392,14 @@ impl crate::TermWindow {
/// the panel does not.
pub(crate) fn workspace_sidebar_hover_hot_zone(&self) -> Option<(usize, usize, usize, usize)> {
let rect = self.workspace_sidebar_rect_for_width(self.workspace_sidebar_docked_width())?;
- let top_tab_bar_height = self.tab_bar_pixel_height().unwrap_or(0.0).ceil() as usize;
+ // The traffic lights stay at the top-left when the window tab row
+ // hides; off macOS nothing of the row's does.
+ let top_tab_bar_height = if cfg!(target_os = "macos") {
+ self.tab_bar_pixel_height().unwrap_or(0.0)
+ } else {
+ self.window_tab_row_drawn_height()
+ }
+ .ceil() as usize;
crate::termwindow::sidebar_hover::hot_zone(
rect.x,
rect.y,