From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26477 invoked from network); 15 Aug 2004 15:20:16 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Aug 2004 15:20:16 -0000 Received: (qmail 51170 invoked from network); 15 Aug 2004 15:20:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Aug 2004 15:20:11 -0000 Received: (qmail 2094 invoked by alias); 15 Aug 2004 15:19:27 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7848 Received: (qmail 2084 invoked from network); 15 Aug 2004 15:19:27 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 15 Aug 2004 15:19:27 -0000 Received: (qmail 49026 invoked from network); 15 Aug 2004 15:17:29 -0000 Received: from rwcrmhc13.comcast.net (204.127.198.39) by a.mx.sunsite.dk with SMTP; 15 Aug 2004 15:17:28 -0000 Received: from durin.aperiodic.net (pcp230226pcs.catonv01.md.comcast.net[68.55.196.13]) by comcast.net (rwcrmhc13) with ESMTP id <2004081515172601500938vae>; Sun, 15 Aug 2004 15:17:26 +0000 Received: from mithrandir.aperiodic.net (mithrandir.aperiodic.net [192.168.1.192]) by durin.aperiodic.net (Postfix) with ESMTP id 0A923384006 for ; Sun, 15 Aug 2004 11:17:25 -0400 (EDT) Received: by mithrandir.aperiodic.net (Postfix, from userid 1000) id BD1C23B76CC4; Sun, 15 Aug 2004 11:17:24 -0400 (EDT) Date: Sun, 15 Aug 2004 11:17:24 -0400 From: Phil!Gregory To: zsh-users@sunsite.dk Subject: Re: Execute a Command in PS1 w/o Disturbing Previous Return Value? Message-ID: <20040815151724.GB5366@mithrandir.aperiodic.net> Mail-Followup-To: zsh-users@sunsite.dk References: <0A5C860F-EE0C-11D8-83BE-000502631FBD@louisville.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0A5C860F-EE0C-11D8-83BE-000502631FBD@louisville.edu> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.5 required=6.0 tests=BAYES_40,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.5 * Aaron Davies [2004-08-14 12:07 -0400]: > I dunno, I can see where someone might want a prompt so complicated it > needed internal error-handling based on return value of executed > commands (cat foo || cat bar, etc.). Would "fixing" this prevent that? Shouldn't. IIRC, the code for precmd is as simple as saving $? at the beginning and then restoring it at the end. (I ran into this problem a while ago and solved it by simply moving all execution into precmd().) -- ...computer contrarian of the first order... / http://aperiodic.net/phil/ PGP: 026A27F2 print: D200 5BDB FC4B B24A 9248 9F7A 4322 2D22 026A 27F2 --- -- You can't wake a person who is pretending to be asleep. -- Navajo Proverb ---- --- --