From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20631 invoked from network); 11 May 2001 08:17:23 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 11 May 2001 08:17:23 -0000 Received: (qmail 22719 invoked by alias); 11 May 2001 08:17:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14310 Received: (qmail 22706 invoked from network); 11 May 2001 08:17:06 -0000 From: "Bart Schaefer" Message-Id: <1010511081509.ZM4744@candle.brasslantern.com> Date: Fri, 11 May 2001 08:15:09 +0000 In-Reply-To: <001c01c0d977$fa1241d0$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "RE: Weird test failures under Cygwin" (May 10, 9:38pm) References: <001c01c0d977$fa1241d0$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Andrej Borsenkow" , "ZSH Workers Mailing List" Subject: Re: Weird test failures under Cygwin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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="" - zpty zsh "$comptest_zsh -f +Z" + zpty zsh "exec $comptest_zsh -f +Z" zpty -r zsh log1 "**" || { 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