mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
Fix hang on exit after child process failed
Quick test (works ~50%) is to press Ctrl+C followed by Ctrl+D. Reproducible on Arch Linux with OpenGL from NVidia. Fixes #228
This commit is contained in:
parent
4dcd7c4c0d
commit
52c979bc08
1 changed files with 3 additions and 9 deletions
12
src/tty.rs
12
src/tty.rs
|
@ -21,7 +21,7 @@ use std::os::unix::process::CommandExt;
|
|||
use std::ptr;
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
use libc::{self, winsize, c_int, pid_t, WNOHANG, WIFEXITED, WEXITSTATUS, SIGCHLD, TIOCSCTTY};
|
||||
use libc::{self, winsize, c_int, pid_t, WNOHANG, SIGCHLD, TIOCSCTTY};
|
||||
|
||||
use term::SizeInfo;
|
||||
use display::OnResize;
|
||||
|
@ -48,15 +48,9 @@ extern "C" fn sigchld(_a: c_int) {
|
|||
die!("Waiting for pid {} failed: {}\n", PID, errno());
|
||||
}
|
||||
|
||||
if PID != p {
|
||||
return;
|
||||
if PID == p {
|
||||
SHOULD_EXIT = true;
|
||||
}
|
||||
|
||||
if !WIFEXITED(status) || WEXITSTATUS(status) != 0 {
|
||||
die!("child finished with error '{}'\n", status);
|
||||
}
|
||||
|
||||
SHOULD_EXIT = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue