diff --git a/mux/src/tab.rs b/mux/src/tab.rs index 4af0c22b4..1afc8e64d 100644 --- a/mux/src/tab.rs +++ b/mux/src/tab.rs @@ -32,6 +32,8 @@ pub struct PositionedPane { pub index: usize, /// true if this is the active pane at the time the position was computed pub is_active: bool, + /// true if this pane is zoomed + pub is_zoomed: bool, /// The offset from the top left corner of the containing tab to the top /// left corner of this pane, in cells. pub left: usize, @@ -549,6 +551,7 @@ impl Tab { panes.push(PositionedPane { index: 0, is_active: true, + is_zoomed: true, left: 0, top: 0, width: size.cols.into(), @@ -590,6 +593,7 @@ impl Tab { panes.push(PositionedPane { index, is_active: index == active_idx, + is_zoomed: false, left, top, width: dims.cols as _, diff --git a/wezterm/src/gui/termwindow.rs b/wezterm/src/gui/termwindow.rs index 0d90937bd..5e164628e 100644 --- a/wezterm/src/gui/termwindow.rs +++ b/wezterm/src/gui/termwindow.rs @@ -1306,28 +1306,37 @@ impl TermWindow { let tab_no = window.get_active_idx(); drop(window); - let title = if let Some(pane) = self.get_active_pane_or_overlay() { - pane.get_title() - } else { - return; - }; + let panes = self.get_panes_to_render(); + if let Some(pos) = panes.iter().find(|p| p.is_active) { + let title = pos.pane.get_title(); - if let Some(window) = self.window.as_ref() { - let show_tab_bar; - if num_tabs == 1 { - window.set_title(&title); - show_tab_bar = config.enable_tab_bar && !config.hide_tab_bar_if_only_one_tab; - } else { - window.set_title(&format!("[{}/{}] {}", tab_no + 1, num_tabs, title)); - show_tab_bar = config.enable_tab_bar; - } + if let Some(window) = self.window.as_ref() { + let show_tab_bar; + if num_tabs == 1 { + window.set_title(&format!( + "{}{}", + if pos.is_zoomed { "[Z] " } else { "" }, + title + )); + show_tab_bar = config.enable_tab_bar && !config.hide_tab_bar_if_only_one_tab; + } else { + window.set_title(&format!( + "{}[{}/{}] {}", + if pos.is_zoomed { "[Z] " } else { "" }, + tab_no + 1, + num_tabs, + title + )); + show_tab_bar = config.enable_tab_bar; + } - // If the number of tabs changed and caused the tab bar to - // hide/show, then we'll need to resize things. It is simplest - // to piggy back on the config reloading code for that, so that - // is what we're doing. - if show_tab_bar != self.show_tab_bar { - self.config_was_reloaded(); + // If the number of tabs changed and caused the tab bar to + // hide/show, then we'll need to resize things. It is simplest + // to piggy back on the config reloading code for that, so that + // is what we're doing. + if show_tab_bar != self.show_tab_bar { + self.config_was_reloaded(); + } } } } @@ -3580,6 +3589,7 @@ impl TermWindow { vec![PositionedPane { index: 0, is_active: true, + is_zoomed: false, left: 0, top: 0, width: size.cols as _,