From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29213 invoked from network); 9 Mar 2008 12:00:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Mar 2008 12:00:37 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 13520 invoked from network); 9 Mar 2008 12:00:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Mar 2008 12:00:18 -0000 Received: (qmail 21847 invoked by alias); 9 Mar 2008 12:00:08 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12704 Received: (qmail 21832 invoked from network); 9 Mar 2008 12:00:07 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 9 Mar 2008 12:00:07 -0000 Received: from mta-1.ms.rz.rwth-aachen.de (mta-1.ms.rz.RWTH-Aachen.DE [134.130.7.72]) by bifrost.dotsrc.org (Postfix) with ESMTP id 5DD188028AED for ; Sun, 9 Mar 2008 13:00:04 +0100 (CET) Received: from ironport-out-1.rz.rwth-aachen.de ([134.130.3.58]) by mta-1.ms.rz.RWTH-Aachen.de (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTP id <0JXG00547PC3US90@mta-1.ms.rz.RWTH-Aachen.de> for zsh-users@sunsite.dk; Sun, 09 Mar 2008 13:00:03 +0100 (CET) Received: from relay.rwth-aachen.de ([134.130.3.1]) by ironport-in-1.rz.rwth-aachen.de with ESMTP; Sun, 09 Mar 2008 13:00:04 +0100 Received: from fsst.voodoo.lan (i577BF501.versanet.de [87.123.245.1]) by relay.rwth-aachen.de (8.13.7/8.13.3/1) with ESMTP id m29C03Ne001551 for ; Sun, 09 Mar 2008 13:00:03 +0100 (MET) Received: from hawk by fsst.voodoo.lan with local (Exim 4.69) (envelope-from ) id 1JYK96-0001Yu-5M for zsh-users@sunsite.dk; Sun, 09 Mar 2008 12:56:52 +0100 Date: Sun, 09 Mar 2008 12:56:52 +0100 From: Frank Terbeck Subject: functions in prompts evaluated twice? To: zsh users Mail-followup-to: zsh users Message-id: <20080309115652.GP30518@fsst.voodoo.lan> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT Content-disposition: inline X-IronPort-AV: E=Sophos;i="4.25,469,1199660400"; d="scan'208";a="55068600" User-Agent: Mutt/1.5.17 (2008-01-15) X-Virus-Scanned: ClamAV 0.91.2/6183/Sun Mar 9 11:42:27 2008 on bifrost X-Virus-Status: Clean Hey list, I was about to use the output of a function in my prompt, when I noticed, that it was evaluated twice. [snip] (6006)-~% zsh -f zsh% setopt promptsubst zsh% foo () { sleep 2 ; } zsh% PROMPT='$(foo)%# ' % set -x +zsh:1> foo +foo:0> sleep 2 +zsh:1> foo +foo:0> sleep 2 % [snap] Is that supposed to be the way it is or is that a bug? Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925