Re: [dev] [st] Understading st behaviour

From: Balazs Kezes <rlblaster_AT_gmail.com>
Date: Tue, 15 Apr 2014 19:19:24 +0100

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
Received on Tue Apr 15 2014 - 20:19:24 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 15 2014 - 20:24:06 CEST