diff options
author | Rachel K <raech.kanati@gmail.com> | 2019-03-12 19:44:47 +0000 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-03-12 19:44:47 +0000 |
commit | 62c1d999e1361fc68ee4e54865b205415fa0a38d (patch) | |
tree | a75dfa202da57d1e7ac9a95b77ee82ef94a49fd6 /src/term/mod.rs | |
parent | e240da9ab3b819a8845ced1ab72d0a4239eac789 (diff) | |
download | alacritty-62c1d999e1361fc68ee4e54865b205415fa0a38d.tar.gz alacritty-62c1d999e1361fc68ee4e54865b205415fa0a38d.zip |
Fix signal handling on Unix systems
This removes the the signal handling machinery in tty::unix, and
replaces it with functionality from signal-hook, which should be more
robust. Signals caught by signal-hook wake up the existing I/O event
loop, which then delegates back to the PTY to handle them.
In particular, this allows `SIGCHLD` (i.e. child process exits) to shut
down the terminal promptly, instead of sometimes leaving the window
lingering.
Fixes #915.
Fixes #1276.
Fixes #1313.
As a side effect, this fixes a very rare bug on Linux, where a `read`
from the PTY on the master side would sometimes "fail" with `EIO` if the
child closed the client side at a particular moment. This was subject to
a race condition, and was very difficult to trigger in practice.
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r-- | src/term/mod.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs index 63b0ca80..fc59ffd6 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -34,6 +34,8 @@ use crate::url::UrlParser; use crate::message_bar::MessageBuffer; use crate::term::color::Rgb; use crate::term::cell::{LineLength, Cell}; + +#[cfg(windows)] use crate::tty; pub mod cell; @@ -1336,7 +1338,7 @@ impl Term { #[inline] pub fn should_exit(&self) -> bool { - tty::process_should_exit() || self.should_exit + self.should_exit } } |