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

Re: exit status problem



On 6 December 2010 12:24, Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> 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.

Do you get the same results with an unset RPS1? Maybe recalculating
the position of the right prompt also does something else as a side
effect.

-- 
Mikael Magnusson



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