jed-users mailing list

[2009 Date Index] [2009 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: signal handler within jed?


On Thu, 5 Mar 2009 01:45:24 +0000 (UTC), Jörg Sommer <joerg@xxxxxxxxxxxx>
wrote:
> XTerm sends SIGHUP before it quits. Try it in a shell:
>
> % trap "echo I don't go" HUP
>
> and try to close the window. Jed should take the SIGHUP as request to

Try the same experiment using rxvt or urxvt,  XTerm may wait for the
process it started to finish but those do not.

>> Perhaps the window manager can be configured to not kill xterm when
>> the user presses the "close" button.
>
> My window manager (IceWM) doesn't kill the window. It send a signal to

As far as I can tell, xterm ignores SIGHUP. I suspect that your WM
sends xterm a ClientMessage Xevent.

> XTerm and XTerm sends SIGHUP to process he has started, e.g. the shell.
> This process passes the signal to its child processes, e.g. jed. This way
> jed can block the closing of the window.

I do not believe it is as simple as that.   Try this:

   xterm -e /bin/bash &
   (or just `xterm &`)

In the newly created xterm window, start another instance of bash:

   bash$ bash
   
In the new bash process, trap SIGHUP:

   bash# trap "echo caught SIGHUP" HUP

Now click the close window button.  You will find that the window will
disappear and if you traced the second bash instance, you will also
see something like:

  write(1, "caught SIGHUP\n"..., 14)      = -1 EIO (Input/output error)
  [...]
  write(2, "bash: echo: write error: Input/ou"..., 44) = -1 EIO (Input/output error)
  [...]
  write(2, "exit\n"..., 5)                = -1 EIO (Input/output error)

As this experiment shows, the second bash process could not stop the
window from being closed.  The real solution is configure the
WM to not decorate the xterm window with a close button.

--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2009 date index] [2009 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]