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

Re: exit status problem



On 2010-12-04 11:36:17 -0800, Bart Schaefer wrote:
> } 2. I type "sleep 5 &".
> } 3. I type "false".
> } 4. I increase the window width.
> } 5. I type [Enter].
> 
> The status you're displaying is $? stored in psvar[1], correct?  And
> that's set by precmd, and you're explicitly calling precmd again on
> TRAPCLD, rather than allowing it to be called in the proper context
> with global status manipulated as it would be at hook time.
> 
> If I use %? instead, I get consistent behavior, that is, the status
> shown in the prompt never changes on window resize.  So I have to
> conclude that this is an effect you've introduced.

What I don't understand is that if the problem is due to the precmd
call from TRAPCLD, then why do I get

ypig:~[1]>                                                    <12:15:32
[1]  + done       sleep 5
ypig:~[1]>                                                    <12:15:35

and not

ypig:~[1]>                                                    <12:15:32
[1]  + done       sleep 5
ypig:~[0]>                                                    <12:15:35

and why do I get "ypig:~[0]>" only after a window resize *and*
typing [Enter]. If I do not resize the window, the prompt is not
changed.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)



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