zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Re: exit status problem
Date: Sun, 5 Dec 2010 16:51:51 +0000	[thread overview]
Message-ID: <20101205165151.643dd5a1@pws-pc.ntlworld.com> (raw)
In-Reply-To: <101204113617.ZM6156@torch.brasslantern.com>

On Sat, 04 Dec 2010 11:36:17 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Dec 4,  2:03am, Vincent Lefevre wrote:
> }
> }   A backgrounded pipeline returns a status of zero.
> } 
> } It seems to be a bug in zsh 4.3.10 that has been fixed in the latest
> } dev versions. Do you have more information?
> 
> It was a bug at least as far back as 4.2.0.  Backgrounded jobs appear
> not to have changed the foreground status until sometime post-4.3.10,
> but I'm not finding a likely-looking ChangeLog entry unless this fix
> was a side-effect of adding POSIX_JOBS behavior.  Or maybe it's this:
> 
> 	* users/15217: Src/Zle/zle_main.c: use top-level status
> 	when redrawing prompt.

(Moved to zsh-workers.)

I can't see it explicitly, either, but there were numerous changes that
vaguely affect the area.  The most likely looks to me like the change
for resetting the status on a command that executes no code: see
zsh-workers/27106 and some later related fixes.  You don't usually get
this at the command line --- you have to do the equivalent of eval'ing
an empty sring --- but it's broadly what's going on here as far as the
main shell is concerned, since all explicit code is executed in a
subshell.

This ensures it stays fixed, now we've noticed.

Index: Test/A05execution.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/A05execution.ztst,v
retrieving revision 1.6
diff -p -u -r1.6 A05execution.ztst
--- Test/A05execution.ztst	7 Aug 2008 16:25:16 -0000	1.6
+++ Test/A05execution.ztst	5 Dec 2010 16:45:53 -0000
@@ -171,3 +171,10 @@
 0:trap ZERR
 >Command failed again.
 >Command failed again.
+
+  false
+  sleep 1000 &
+  print $?
+  kill $!
+0:Status reset by starting a backgrounded command
+>0


-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


           reply	other threads:[~2010-12-05 17:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <101204113617.ZM6156@torch.brasslantern.com>]

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=20101205165151.643dd5a1@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /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).