From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7445 invoked by alias); 27 Dec 2011 07:40:58 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16670 Received: (qmail 16601 invoked from network); 27 Dec 2011 07:40:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <111226234028.ZM23820@torch.brasslantern.com> Date: Mon, 26 Dec 2011 23:40:28 -0800 In-reply-to: <20111224111347.GE3506@xvii.vinc17.org> Comments: In reply to Vincent Lefevre "PRINT_EXIT_VALUE problems" (Dec 24, 12:13pm) References: <20111224111347.GE3506@xvii.vinc17.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: PRINT_EXIT_VALUE problems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii [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.