This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Thomas Wolff wrote:Common practice in Unix/Linux/X environments. And user expectation that an interactive session (which may e.g. contain an editing session with unsaved changes...) should not be aborted by an unrelated event.
In general, a GUI application started in the background, like a terminal,Says who?
should detach itself from its parent process so that it survives if the
parent is terminated.
You can always invoke it with setsid or some such to detach it.Which is not common user practice when starting a terminal, though.
Actually (another topic but related) mintty has a great feature here: it passed the SIGHUP to its client application and if that application catches and handles the SIGHUP, mintty does *not* exit. This enables an application to be embedded into mintty as a terminal container and implement some reasonable "Really exit?" behaviour with the option not to exit.I've noticed the following sometimes surprising inconsistencies about this:Mintty has default handling for SIGHUP, i.e. it exits.
mintty
xterm&
mintty&
Close/Alt-F4
-> dialog "Processes are running in session. Exit anyway?"
OK
-> xterm remains
-> mintty is killed
xterm
xterm&
mintty&
Close/Quit
-> xterm remains
-> mintty is killed
Same for rxvt. Xterm presumably chooses to ignore it.Thanks for the interesting technical background. From the user experience point of view, however, it doesn't make a difference how the terminal is implemented if an important active session just suddenly shuts down... Especially if it may happen or not in various inconsistent combinations which cannot be predicted without remembering the technical background.
minttyI don't understand why there isn't a SIGUP in these cases.
xterm&
mintty&
exit
-> all child terminals remain
xterm
xterm&
mintty&
exit
-> all child terminals remain
cygwin console
xterm&
mintty&
exit/Alt-F4
-> console hangs
It's not really hanging; it's just waiting for xterm to finish. Xterm is linked as a console subsystem program, which means at startup it attaches to its parent's console (or opens its own if there isn't one). Consoles stay open as long as there's at least one process attached to them.
Mintty, meanwhile, is a GUI subsystem program, which means it doesn't
attach to or open a console.
So maybe this would be an enhancement item for the cygwin dll, that an application that detaches from its parent tty in Unix/Linux terms (don't remember the details how to do this) should also be detached from the console, if possible?CloseWhen a console is closed, Windows kills all processes attached to it.
-> mintty remains
-> xterm is killed
Also, mintty can be protected from being killed by spawning it withYep, doing that doesn't break the console attachment.
(mintty&)
while xterm, spawned this way from a cygwin console, still gets killed.
-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |