mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
waitpid should specify WNOHANG
If the child process our terminal is executing behaves poorly and doesn't waitpid all of its own children, then we can hang the full terminal. This is not ideal, so specify WNOHANG.
This commit is contained in:
@ -186,7 +186,10 @@ fn setupFd(src: File.Handle, target: i32) !void {
|
|||||||
|
|
||||||
/// Wait for the command to exit and return information about how it exited.
|
/// Wait for the command to exit and return information about how it exited.
|
||||||
pub fn wait(self: Command) !Exit {
|
pub fn wait(self: Command) !Exit {
|
||||||
const res = std.os.waitpid(self.pid.?, 0);
|
// We specify NOHANG because its not our fault if the process we launch
|
||||||
|
// for the tty doesn't properly waitpid its children. We don't want
|
||||||
|
// to hang the terminal over it.
|
||||||
|
const res = std.os.waitpid(self.pid.?, std.c.W.NOHANG);
|
||||||
return Exit.init(res.status);
|
return Exit.init(res.status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user