summaryrefslogtreecommitdiffstats
path: root/Src/init.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-12 18:04:00 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-12 18:04:00 +0000
commit3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d (patch)
tree5f62524735b99d915503120e5a33a3778682adea /Src/init.c
parentmanual/9693 (diff)
downloadzsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.tar
zsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.tar.gz
zsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.tar.bz2
zsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.tar.lz
zsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.tar.xz
zsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.tar.zst
zsh-3fa0e7d4d3fbf0287cb8b716f1ce4c3595c2d32d.zip
zsh-workers/9694
Diffstat (limited to 'Src/init.c')
-rw-r--r--Src/init.c4
1 files changed, 3 insertions, 1 deletions
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