aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-11-11 18:00:08 -0800
committerJoe Wilm <joe@jwilm.com>2016-11-11 18:02:38 -0800
commite4260134aa6bdb436373fdecfbde1e9262d15bc2 (patch)
treeb207f83e847e944a0c545207de60246426dc56ac /src
parent8cbd7680944b8a453f86d6c5e6ba4e8c3aeccb6e (diff)
downloadalacritty-e4260134aa6bdb436373fdecfbde1e9262d15bc2.tar.gz
alacritty-e4260134aa6bdb436373fdecfbde1e9262d15bc2.zip
Fix alacritty shutdown when shell exits on macOS
Readiness for the pty file descriptor will never be HUP or ERROR; the out-of-band flag raised by sigchld is used instead. Resolves #14.
Diffstat (limited to 'src')
-rw-r--r--src/event_loop.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/event_loop.rs b/src/event_loop.rs
index 9584e416..7c00dd36 100644
--- a/src/event_loop.rs
+++ b/src/event_loop.rs
@@ -263,6 +263,9 @@ impl<Io> EventLoop<Io>
if kind.is_readable() {
self.pty_read(&mut state, &mut buf);
+ if ::tty::process_should_exit() {
+ break 'event_loop;
+ }
}
if kind.is_writable() {
@@ -289,8 +292,8 @@ impl<Io> EventLoop<Io>
}
}
- self.poll.deregister(&self.rx).expect("deregister channel");
- self.poll.deregister(&fd).expect("deregister pty");
+ let _ = self.poll.deregister(&self.rx);
+ let _ = self.poll.deregister(&fd);
(self, state)
})