From c76d4822aad834996012d460d3eef034df77c593 Mon Sep 17 00:00:00 2001 From: raphTec Date: Wed, 13 Apr 2022 23:38:22 +0200 Subject: [PATCH] Fix #1286 by sending SIGHUP when closing a pane 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> {