From d4b8199d025cd6c470067fd4b2dfa203ecb5e012 Mon Sep 17 00:00:00 2001 From: raphCode <15750438+raphCode@users.noreply.github.com> Date: Fri, 15 Apr 2022 19:47:46 +0200 Subject: [PATCH] fix(pty): send SIGHUP instead of SIGTERM when closing a pane (#1320) 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. --- zellij-server/src/os_input_output.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index f0b49c68b0..7905a6e3e1 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -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> {