From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10190 invoked by alias); 28 Dec 2011 16:32:31 -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: 16672 Received: (qmail 5843 invoked from network); 28 Dec 2011 16:32:28 -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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.215.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=gmIMTZ3Tx3P+omX1Req0IT9Ahvb5VmczOS+deadOUe0=; b=Xkw972bjjlVMbDTZhCPmaVHATGv10MRViukYPQM306ZKAAWIkegaNAwvj2poAWpOeC oO8zEdXDF8Iwbty+WGxs4tt0wLdsiO5RFv9RKAfEakRm5ofogVlV/I7iWikaipldyeSr TeWGkZOIbtWJjA/DqRvWIHCiVbS10bbbfAl6k= MIME-Version: 1.0 Sender: ndorfman@gmail.com In-Reply-To: <20111224111347.GE3506@xvii.vinc17.org> References: <20111224111347.GE3506@xvii.vinc17.org> Date: Wed, 28 Dec 2011 11:26:01 -0500 X-Google-Sender-Auth: 0oymqecxtw46wBT3vuAJT5z1Bug Message-ID: Subject: Re: PRINT_EXIT_VALUE problems From: Nathan Dorfman To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 On Sat, Dec 24, 2011 at 6:13 AM, Vincent Lefevre wrote: > Hi, > > This is not new, but there are two problems with the PRINT_EXIT_VALUE > option. They can be shown on the following example (under Debian): > > $ zsh-beta -f > xvii% echo $ZSH_VERSION > 4.3.15-dev-0-cvs1220 > xvii% setopt PRINT_EXIT_VALUE > xvii% false || true > zsh: exit 1 > xvii% Unrelated to the apparent bug you've described, I've been using a different mechanism to achieve the effect that (I think) you want. $? does the right thing: % false || true ; echo $? 0 % false && true ; echo $? 1 You can use the %? sequence in your prompt to see the exit value; what I do is actually use the following: %(?// %?? ) This expands to " 1? " after false && true, and the empty string "" after false || true. I find this really handy as the prompt is different enough to draw my attention after a non-zero exit status. Hope this helps, -nd.