1 diff --git a/src/runtime/run-program.c b/src/runtime/run-program.c
2 index 77a93d5..d1d98e6 100644
3 --- a/src/runtime/run-program.c
4 +++ b/src/runtime/run-program.c
5 @@ -65,16 +65,22 @@ int spawn(char *program, char *argv[], int sin, int sout, int serr,
9 - /* Put us in our own process group. */
10 + /* Put us in our own process group, but only if we need not
11 + * share stdin with our parent. In the latter case we claim
12 + * control of the terminal. */
14 #if defined(LISP_FEATURE_HPUX)
17 #elif defined(LISP_FEATURE_DARWIN)
18 - setpgid(0, getpid());
19 + setpgid(0, getpid());
20 #elif defined(SVR4) || defined(__linux__) || defined(__osf__)
24 - setpgrp(0, getpid());
25 + setpgrp(0, getpid());
28 + tcsetpgrp(0, getpgrp());