zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: PRINT_EXIT_VALUE problems
Date: Mon, 26 Dec 2011 23:40:28 -0800	[thread overview]
Message-ID: <111226234028.ZM23820@torch.brasslantern.com> (raw)
In-Reply-To: <20111224111347.GE3506@xvii.vinc17.org>

[I suggest further discussion go to zsh-workers rather than -users.]

On Dec 24, 12:13pm, Vincent Lefevre wrote:
}
} xvii% setopt PRINT_EXIT_VALUE
} xvii% false || true
} zsh: exit 1
} 
} 1. I don't think the value should be printed in the case of a program
} before ||, because the goal of || is to ignore or handle the error.

Hrm.  This is a bit problematic.  The call stack is something like
this (deepest frame at bottom):

	execode()
	execlist()	<- here we know the state of "&&"/"||"
	execpline()	<- here we print exit of external jobs [*]
	execpline2()
	execcmd()	<- here we print exit of builtins/functions

[*] which really happens via the SIGCHLD handler, but we wait there.

So in order to suppress printing on the left side of "||", execlist()
will need to record that state in a location that can be read both
from printjob() as called by the signal handler, and from execcmd();
or, we need to pull this out of both of those places and put it into
execlist().

} 2. Here zsh doesn't say which program failed. I suppose that the
} problem is due to the fact that "false" is a builtin.

This actually might be easier to fix, execcmd() should be able to get
the name of the function or builtin it was executing.


  reply	other threads:[~2011-12-27  7:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-24 11:13 Vincent Lefevre
2011-12-27  7:40 ` Bart Schaefer [this message]
2011-12-27 17:30   ` Bart Schaefer
2011-12-28 19:28   ` Bart Schaefer
2011-12-29  2:36     ` Vincent Lefevre
2011-12-30 20:11     ` autoload syntax Ray Andrews
2011-12-30 21:07       ` Bart Schaefer
2011-12-31  3:32         ` Mark van Dijk
2012-01-04 17:35         ` Ray Andrews
2012-01-05 20:13           ` Peter Stephenson
2012-01-05 20:32             ` Ray Andrews
2012-01-05 21:01               ` Peter Stephenson
2012-01-05 21:06               ` Mikael Magnusson
     [not found]                 ` <4F06163D.9040800@eastlink.ca>
2012-01-05 21:33                   ` Mikael Magnusson
2011-12-28 16:26 ` PRINT_EXIT_VALUE problems Nathan Dorfman
2011-12-28 18:42   ` Vincent Lefevre

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=111226234028.ZM23820@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).