master hovercats/oakiss / pkg / st / patch / 0002-Only-send-SIGHUP-on-close-when-using-PTY.patch
 1From 6ee6144c159551d45f0e02a87b5635c29e48fbbf Mon Sep 17 00:00:00 2001
 2From: Michael Forney <mforney@mforney.org>
 3Date: Sat, 22 Feb 2020 17:17:01 -0800
 4Subject: [PATCH] Only send SIGHUP on close when using PTY
 5
 6Otherwise, pid is at its default value (0), so SIGHUP gets sent to
 7the entire process group.
 8---
 9 st.c | 6 ++++--
10 1 file changed, 4 insertions(+), 2 deletions(-)
11
12diff --git a/st.c b/st.c
13index 913c71b..20a3c3c 100644
14--- a/st.c
15+++ b/st.c
16@@ -4325,8 +4325,10 @@ toplevelconfigure(void *data, struct xdg_toplevel *toplevel, int32_t w, int32_t
17 void
18 toplevelclose(void *data, struct xdg_toplevel *toplevel)
19 {
20-	/* Send SIGHUP to shell */
21-	kill(pid, SIGHUP);
22+	if (pid) {
23+		/* Send SIGHUP to shell */
24+		kill(pid, SIGHUP);
25+	}
26 	exit(0);
27 }
28 
29-- 
302.37.3
31