Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: What's the last command in prompt expansion?



Hallo Peter,

Peter Stephenson <pws@xxxxxxx> wrote:
> On Tue, 15 Dec 2009 10:02:31 +0000
> Peter Stephenson <pws@xxxxxxx> 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 <joerg@xxxxxxx>, <b4ai4o$1u8vmt$2@xxxxxxxxxxxxxxxxxxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author