X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fpty.c;h=bef9f2fab429a5b60f8f09ec02b2e99f40949e38;hb=11655820ca7ba0e3f15a900eb3c75f60b66944d5;hp=86e1e41023d3c5cff327298f497392c2c9b5f431;hpb=4f197b872e73d0066bd2f3ecf9124befccd77d2d;p=PuTTY.git diff --git a/unix/pty.c b/unix/pty.c index 86e1e410..bef9f2fa 100644 --- a/unix/pty.c +++ b/unix/pty.c @@ -474,6 +474,8 @@ int pty_select_result(int fd, int event) #endif from_backend(pty_frontend, 0, message, strlen(message)); } + + notify_remote_exit(pty_frontend); } return !finished; } @@ -577,9 +579,9 @@ static const char *pty_init(void *frontend, void **backend_handle, Config *cfg, ioctl(slavefd, TIOCSCTTY, 1); pgrp = getpid(); tcsetpgrp(slavefd, pgrp); - setpgrp(pgrp, pgrp); + setpgid(pgrp, pgrp); close(open(pty_name, O_WRONLY, 0)); - setpgrp(pgrp, pgrp); + setpgid(pgrp, pgrp); /* Close everything _else_, for tidiness. */ for (i = 3; i < 1024; i++) close(i); @@ -619,10 +621,13 @@ static const char *pty_init(void *frontend, void **backend_handle, Config *cfg, /* * SIGINT and SIGQUIT may have been set to ignored by our * parent, particularly by things like sh -c 'pterm &' and - * some window managers. Reverse this for our child process. + * some window managers. SIGCHLD, meanwhile, was blocked + * during pt_main() startup. Reverse all this for our child + * process. */ putty_signal(SIGINT, SIG_DFL); putty_signal(SIGQUIT, SIG_DFL); + block_signal(SIGCHLD, 0); if (pty_argv) execvp(pty_argv[0], pty_argv); else {