From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7145 invoked from network); 3 Jul 2005 22:32:31 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Jul 2005 22:32:31 -0000 Received: (qmail 77768 invoked from network); 3 Jul 2005 22:32:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Jul 2005 22:32:23 -0000 Received: (qmail 16226 invoked by alias); 3 Jul 2005 22:32:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9013 Received: (qmail 16215 invoked from network); 3 Jul 2005 22:32:14 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Jul 2005 22:32:14 -0000 Received: (qmail 76780 invoked from network); 3 Jul 2005 22:32:14 -0000 Received: from mxfep01.bredband.com (195.54.107.70) by a.mx.sunsite.dk with SMTP; 3 Jul 2005 22:32:09 -0000 Received: from puritan.pnetwork ([213.112.43.228] [213.112.43.228]) by mxfep01.bredband.com with ESMTP id <20050703223209.MDVY24612.mxfep01.bredband.com@puritan.pnetwork> for ; Mon, 4 Jul 2005 00:32:09 +0200 Received: by puritan.pnetwork (Postfix, from userid 1000) id 915EAADFEA; Mon, 4 Jul 2005 00:32:09 +0200 (CEST) Date: Mon, 4 Jul 2005 00:32:09 +0200 From: Nikolai Weibull To: zsh-users Subject: Re: reinventing print_exit_value Message-ID: <20050703223209.GA5083@puritan.pnetwork> Mail-Followup-To: zsh-users References: <200507032356.17308.cht@chello.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200507032356.17308.cht@chello.at> User-Agent: Mutt/1.5.8i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Christian Taylor wrote: > I recently decided that I want the exit code of the last command (if it's > greater than 0) displayed after invoking it, like the PRINT_EXIT_VALUE option > does, but in my own format. (I don't want to include it in my prompt.) Actually, you _do_ want to include it in your prompt. Simply use %(?..status: %?) in your prompt, and it will only be displayed when there's something to display (non-zero exit value in this case), nikolai -- Nikolai Weibull: now available free of charge at http://bitwi.se/! Born in Chicago, IL USA; currently residing in Gothenburg, Sweden. main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}