From 3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sat, 12 Feb 2000 18:04:00 +0000 Subject: zsh-workers/9694 --- Src/init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Src/init.c') diff --git a/Src/init.c b/Src/init.c index 08fd2a4c4..5a6139438 100644 --- a/Src/init.c +++ b/Src/init.c @@ -401,7 +401,10 @@ init_io(void) if (opts[MONITOR] && interact && (SHTTY != -1)) { if ((mypgrp = GETPGRP()) > 0) { while ((ttpgrp = gettygrp()) != -1 && ttpgrp != mypgrp) { + sleep(1); /* give parent time to change pgrp */ mypgrp = GETPGRP(); + if (mypgrp == mypid) + attachtty(mypgrp); if (mypgrp == gettygrp()) break; killpg(mypgrp, SIGTTIN); @@ -411,7 +414,6 @@ init_io(void) opts[MONITOR] = 0; } else opts[MONITOR] = 0; - attachtty(GETPGRP()); #else opts[MONITOR] = 0; #endif -- cgit 1.4.1