1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 16:08:34 +03:00

clean up process death detection on windows w/ new frontend

This commit is contained in:
Wez Furlong 2019-10-25 08:26:38 -07:00
parent fc918c2f4d
commit 3ca3b3196e
2 changed files with 27 additions and 2 deletions

View File

@ -230,8 +230,19 @@ impl Mux {
}
}
let dead_tab_ids: Vec<TabId> = self
.tabs
.borrow()
.iter()
.filter_map(|(&id, tab)| if tab.is_dead() { Some(id) } else { None })
.collect();
for tab_id in dead_tab_ids {
self.tabs.borrow_mut().remove(&tab_id);
}
for window_id in dead_windows {
debug!("removing window {}", window_id);
error!("removing window {}", window_id);
windows.remove(&window_id);
}
}
@ -274,7 +285,6 @@ impl Mux {
Ok(())
}
#[allow(dead_code)]
pub fn is_empty(&self) -> bool {
self.tabs.borrow().is_empty()
}

View File

@ -89,6 +89,21 @@ impl Window {
}
pub fn prune_dead_tabs(&mut self, live_tab_ids: &[TabId]) {
let dead: Vec<TabId> = self
.tabs
.iter()
.filter_map(|tab| {
if tab.is_dead() {
Some(tab.tab_id())
} else {
None
}
})
.collect();
for tab_id in dead {
self.remove_by_id(tab_id);
}
let dead: Vec<TabId> = self
.tabs
.iter()