1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-22 21:01:36 +03:00

use iter_panes_ignoring zoom in more places in the mux

`iter_panes` returns the renderable set of panes, but most functions
in the mux want to operate on the full set of panes.

Notably, when closing a tab, we were not killing panes other than
the zoomed pane, which caused wezterm to linger in the background.

refs: https://github.com/wez/wezterm/issues/2548
This commit is contained in:
Wez Furlong 2022-09-23 16:44:03 -07:00
parent 8e7a2cce79
commit 61752504dd
4 changed files with 10 additions and 6 deletions

View File

@ -61,6 +61,9 @@ As features stabilize some brief notes about them will accumulate here.
active [#2529](https://github.com/wez/wezterm/issues/2529)
* Overlays did not see config overrides set via `window:set_config_overrides`
[#2544](https://github.com/wez/wezterm/issues/2544)
* Closing a window while tab had a zoomed pane would leave the other panes
untouched and wezterm would linger in the background
[#2548](https://github.com/wez/wezterm/issues/2548)
#### Changed
* Removed Last Resort fallback font

View File

@ -82,7 +82,7 @@ pub trait Domain: Downcast {
};
let pane_index = match tab
.iter_panes()
.iter_panes_ignoring_zoom()
.iter()
.find(|p| p.pane.pane_id() == pane_id)
{

View File

@ -685,9 +685,10 @@ impl Mux {
}
let mut pane_ids = vec![];
for pos in tab.iter_panes() {
for pos in tab.iter_panes_ignoring_zoom() {
pane_ids.push(pos.pane.pane_id());
}
log::debug!("panes to remove: {pane_ids:?}");
for pane_id in pane_ids {
self.remove_pane_internal(pane_id);
}
@ -893,7 +894,7 @@ impl Mux {
pub fn resolve_pane_id(&self, pane_id: PaneId) -> Option<(DomainId, WindowId, TabId)> {
let mut ids = None;
for tab in self.tabs.borrow().values() {
for p in tab.iter_panes() {
for p in tab.iter_panes_ignoring_zoom() {
if p.pane.pane_id() == pane_id {
ids = Some((tab.tab_id(), p.pane.domain_id()));
break;

View File

@ -1484,7 +1484,7 @@ impl Tab {
}
pub fn can_close_without_prompting(&self, reason: CloseReason) -> bool {
let panes = self.iter_panes();
let panes = self.iter_panes_ignoring_zoom();
for pos in &panes {
if !pos.pane.can_close_without_prompting(reason) {
return false;
@ -1511,7 +1511,7 @@ impl Tab {
return Some(Rc::clone(zoomed));
}
self.iter_panes()
self.iter_panes_ignoring_zoom()
.iter()
.nth(*self.active.borrow())
.map(|p| Rc::clone(&p.pane))
@ -1524,7 +1524,7 @@ impl Tab {
pub fn set_active_pane(&self, pane: &Rc<dyn Pane>) {
if let Some(item) = self
.iter_panes()
.iter_panes_ignoring_zoom()
.iter()
.find(|p| p.pane.pane_id() == pane.pane_id())
{