From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>,
"ZSH Workers Mailing List" <zsh-workers@sunsite.dk>
Subject: Re: Weird test failures under Cygwin
Date: Fri, 11 May 2001 08:15:09 +0000 [thread overview]
Message-ID: <1010511081509.ZM4744@candle.brasslantern.com> (raw)
In-Reply-To: <001c01c0d977$fa1241d0$21c9ca95@mow.siemens.ru>
On May 10, 9:38pm, Andrej Borsenkow wrote:
}
} Something has changed in the way zpty runs commands
The thing that changed about the way zpty runs commands is, zsh forks
and then the subshell then runs the command on the pty. This allows you
to run shell functions, loops, pipelines, etc. on the pty rather than
running only a single simple external command.
} Look here:
}
} PID PPID PGID WINPID TTY UID STIME COMMAND
} 3140 2216 3140 3140 1 1006 21:30:23 /usr/bin/zsh
} 2412 3140 2412 2696 1 1006 21:30:24 /usr/bin/zsh
}
} The tty0 is my current and tty1 is pts; when I unload zpty (test does
} it) it basically sends HUP to tty group - but we have *two* tty groups
} here.
Here's what I get on linux ("ps j" output):
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
3646 3657 3657 3612 pc 4149 S 11 0:00 zsh-4.0.1-pre-4
3657 3684 3684 3684 a0 3685 S 11 0:00 zsh-4.0.1-pre-4
3684 3685 3685 3684 a0 3685 S 11 0:00 zsh-4.0.1-pre-4
3684 is the forked subshell, and 3685 is the external command. You can
see this better if I use "zpty bash bash":
PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND
3646 3657 3657 3612 pc 4149 S 11 0:00 zsh-4.0.1-pre-4
3657 4147 4147 4147 a0 4148 S 11 0:00 zsh-4.0.1-pre-4
4147 4148 4148 4147 a0 4148 S 11 0:00 bash
Note that there are two process groups, but only one controlling tty
process group ... but whichever one I send a HUP to, they both exit.
In your case, the subshell is hanging around even though the command
it was running has exited. That's not supposed to happen; even if the
subshell didn't get the SIGHUP, it should get the SIGCHLD and realize
it has no more reason to live.
} So the second zsh is stuck around with Test/comp.tmp as current dir
You can eliminate the subshell in comptest with the patch below, but it
would be good to find out what that subshell is waiting around for in
the general case.
Index: Test/comptest
===================================================================
--- Test/comptest 2001/05/09 04:42:14 1.2
+++ Test/comptest 2001/05/11 08:08:00
@@ -18,7 +18,7 @@
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
export PS1="<PROMPT>"
- zpty zsh "$comptest_zsh -f +Z"
+ zpty zsh "exec $comptest_zsh -f +Z"
zpty -r zsh log1 "*<PROMPT>*" || {
print "first prompt hasn't appeared."
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
next prev parent reply other threads:[~2001-05-11 8:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-10 15:57 Andrej Borsenkow
2001-05-10 17:20 ` Bart Schaefer
2001-05-10 17:38 ` Andrej Borsenkow
2001-05-11 8:15 ` Bart Schaefer [this message]
2001-05-10 17:53 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1010511081509.ZM4744@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--cc=Andrej.Borsenkow@mow.siemens.ru \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).