Tab::process -> Tab::is_dead

This commit is contained in:
Wez Furlong committed 2019-03-02 13:36:28 -08:00
1 parent 9520970b66
commit fa0ea270f4
2 files changed
+9 -5

No files matched your search

+6 -2
View File
@@ -34,8 +34,12 @@ impl Tab {
self.terminal.borrow_mut()
}
pub fn process(&self) -> RefMut<Child> {
self.process.borrow_mut()
pub fn is_dead(&self) -> bool {
if let Ok(None) = self.process.borrow_mut().try_wait() {
false
} else {
true
}
}
pub fn resize(
+3 -3
View File
@@ -250,10 +250,10 @@ pub trait TerminalWindow {
let dead_tabs: Vec<Rc<Tab>> = tabs
.iter()
.filter_map(|tab| {
if let Ok(None) = tab.process().try_wait() {
None
} else {
if tab.is_dead() {
Some(Rc::clone(tab))
} else {
None
}
})
.collect();