1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-06 22:12:47 -05:00

xterm-class programs should exit when their primary child process

dies, rather than waiting around until the last open handle on the
pty closes.

[originally from svn r2044]
This commit is contained in:
Simon Tatham
2002-10-14 09:18:34 +00:00
parent b3072e227e
commit 76cda50683
2 changed files with 35 additions and 0 deletions

View File

@ -710,6 +710,19 @@ gint motion_event(GtkWidget *widget, GdkEventMotion *event, gpointer data)
gint timer_func(gpointer data)
{
/* struct gui_data *inst = (struct gui_data *)data; */
extern int pty_child_is_dead(); /* declared in pty.c */
if (pty_child_is_dead()) {
/*
* The primary child process died. We could keep the
* terminal open for remaining subprocesses to output to,
* but conventional wisdom seems to feel that that's the
* Wrong Thing for an xterm-alike, so we bail out now. This
* would be easy enough to change or make configurable if
* necessary.
*/
exit(0);
}
term_update();
return TRUE;