1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 06:12:16 +03:00

fix unterminated loop when a tab is closed and others remain

We weren't detecting EOF reading from the pty
This commit is contained in:
Wez Furlong 2019-02-23 14:34:17 -08:00
parent db5aac6681
commit 7a1d691163

View File

@ -328,6 +328,11 @@ impl GuiEventLoop {
let mut buf = [0; BUFSIZE];
loop {
match pty.read(&mut buf) {
Ok(size) if size == 0 => {
eprintln!("read_pty EOF: window {:?} {}", window_id, tab_id);
tx.send(IOEvent::Terminated { window_id, tab_id }).ok();
return;
}
Ok(size) => {
if tx
.send(IOEvent::Data {
@ -341,7 +346,10 @@ impl GuiEventLoop {
}
}
Err(err) => {
eprintln!("window {:?} {} {:?}", window_id, tab_id, err);
eprintln!(
"read_pty failed: window {:?} {} {:?}",
window_id, tab_id, err
);
tx.send(IOEvent::Terminated { window_id, tab_id }).ok();
return;
}