On 2014-04-15 18:44 +0200, Markus Wichmann wrote:
> st reacted to the DELETE_WINDOW message by killing the shell with
> SIGHUP. Now, your shell may ignore SIGHUP, since it is waiting for
> mutt to finish. Or it may die. If it died and sent mutt the SIGHUP,
> too, that would be great, however, some shells don't send SIGHUP on
> exit by default, and some users don't want that.

Shouldn't you be sending the SIGHUP to the shell's process group instead
of just to shell? E.g.

        } else if(e->xclient.data.l[0] == xw.wmdeletewin) {
                /* Send SIGHUP to shell */
-               kill(pid, SIGHUP);
+               kill(-pid, SIGHUP);
                exit(EXIT_SUCCESS);
        }

xterm does this[1]. SIGWINCH should be sent the same way but I'm not
sure how is st handling that (I'm not using it, I'm just a lurker).

[1] Search for kill_process_group(screen->pid, SIGHUP) in
http://www.opensource.apple.com/source/X11apps/X11apps-13/xterm/xterm-207/misc.c

-- 
Balazs

Reply via email to