Skip to content

Commit

Permalink
fix(pty): send SIGHUP instead of SIGTERM when closing a pane (#1320)
Browse files Browse the repository at this point in the history
SIGHUP correctly states the intention behind sending a signal when a
pane is closed: The controlling terminal is "hung up".
Also, SIGHUP is better suited than SIGTERM since bash ignores the
latter. This led to the zombie processes observed by some users.
Furthermore, SIGHUP has a special meaning in bash's job control, namely
re-sending the signal to all owned jobs before exiting.
  • Loading branch information
raphCode authored Apr 15, 2022
1 parent ae3dde3 commit d4b8199
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zellij-server/src/os_input_output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl ServerOsApi for ServerOsInputOutput {
Box::new((*self).clone())
}
fn kill(&self, pid: Pid) -> Result<(), nix::Error> {
let _ = kill(pid, Some(Signal::SIGTERM));
let _ = kill(pid, Some(Signal::SIGHUP));
Ok(())
}
fn force_kill(&self, pid: Pid) -> Result<(), nix::Error> {
Expand Down

0 comments on commit d4b8199

Please sign in to comment.