commit b145b87ab7eae711275a5ea8ad4568980d8b2970
parent 417c04e999cfc910ad2ace83834c45d1d8fb05ff
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 22 Feb 2020 17:17:01 -0800
Only send SIGHUP on close when using PTY
Otherwise, pid is at its default value (0), so SIGHUP gets sent to
the entire process group.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/st.c b/st.c
@@ -4324,8 +4324,10 @@ toplevelconfigure(void *data, struct xdg_toplevel *toplevel, int32_t w, int32_t
void
toplevelclose(void *data, struct xdg_toplevel *toplevel)
{
- /* Send SIGHUP to shell */
- kill(pid, SIGHUP);
+ if (pid) {
+ /* Send SIGHUP to shell */
+ kill(pid, SIGHUP);
+ }
exit(0);
}