From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13385 invoked by alias); 18 Dec 2009 23:12:42 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 27533 Received: (qmail 12611 invoked from network); 18 Dec 2009 23:12:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_06_12,DKIM_SIGNED,DKIM_VERIFIED,SPF_HELO_PASS autolearn=no version=3.2.5 Received-SPF: pass (ns1.primenet.com.au: SPF record at alea.gnuu.de designates 83.246.114.63 as permitted sender) X-DKIM: Sendmail DKIM Filter v2.5.2 uucp.gnuu.de 85E01488034 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gnuu.de; s=banki; t=1261177945; i=@alea.gnuu.de; bh=zVRPdKSO2NGtODVPHygMbXVIwHl05ZN0h bKZW09Udo0=; h=To:From:Subject:Date:Message-ID:References: Mime-Version:Content-Type:Content-Transfer-Encoding:Sender; b=vGqH rC/DK+mnIv6pjjvAvsJ0C8/86sX0xQedg0o39nn5/xexbmBFmCWTDiuguLkftxxaeVc 3Z3/V22/SsQscmOxstlnUs0utJcfs1o0Zqa3zRDy+jbSWv+f42qOfLudo61VfMRUeVV QvaCgXXA1OwC7HA9hD9BbhUvm7XqlmlcE= To: zsh-workers@zsh.org Path: not-for-mail From: =?UTF-8?Q?J=C3=B6rg?= Sommer Newsgroups: local.mailinglist.zsh Subject: Re: What's the last command in prompt expansion? Date: Fri, 18 Dec 2009 16:45:16 +0000 (UTC) Message-ID: References: <200912151002.nBFA2Ve3029420@news01.csr.com> <20091215102309.640a5a14@news01> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: alea.gnuu.de 1261154716 10396 192.168.0.5 (18 Dec 2009 16:45:16 GMT) X-Complaints-To: usenet@alea.gnuu.de User-Agent: slrn/pre1.0.0-11 (Linux) Sender: news Hallo Peter, Peter Stephenson wrote: > On Tue, 15 Dec 2009 10:02:31 +0000 > Peter Stephenson wrote: >> Traps don't save and restore the status. This is deliberate, they are >> supposed to be able to return a status to the surrounding environment. > > Actually, I've overstated the case here. If a trap function doesn't > execute a "return" explicitly, the status should be maintained unless there > was an error. So in general your TRAPALRM ought not to change it. The problem is not the return value of TRAPALRM, but the change of PS1. % zsh -f ibook% PS1='%? %% ' 0 % TRAPALRM() { PS1=$PS1; zle reset-prompt; TMOUT=0; } 0 % TMOUT=1; false 0 % Bye, Jörg. -- Es ist außerdem ein weit verbreiteter Irrtum das USENET ‚helfen‘ soll. Tatsächlich wurde USENET nachweislich zur persönlichen Belustigung seiner Erfinder geschaffen. Jörg Klemenz ,