diff options
author | Joe Wilm <joe@jwilm.com> | 2016-11-11 18:00:08 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-11-11 18:02:38 -0800 |
commit | e4260134aa6bdb436373fdecfbde1e9262d15bc2 (patch) | |
tree | b207f83e847e944a0c545207de60246426dc56ac /src | |
parent | 8cbd7680944b8a453f86d6c5e6ba4e8c3aeccb6e (diff) | |
download | alacritty-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.rs | 7 |
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) }) |