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

Re: zle reset-prompt



Peter Stephenson wrote:
> On Fri, 30 Jul 2010 16:08:28 +0200
> Simon Friedberger <simon+zsh@xxxxxxxxxx> wrote:
>> OK, so I tried a couple of possible calls with ESC x and the functions
>> in my prompt config.
>> It seems that zle-keymap-select might be the perpetrator.
>> Does that make any more sense?
>
> Not so far as I can see... I've run "bindkey -v", defined
>
> zle-keymap-select() { print Status $?; } 
> zle -N zle-keymap-select
>
> the run "false", and when I hit ESC and i in turn I get "Status 1"
> repeatedly.  If I've understood your problem, you're saying this would
> give "Status 0" at some point.

Yeah, it doesn't mess with `$?'.

But here's something I'm finding odd. Consider this setup from "zsh -f":

[snip]
bindkey -e
PS1='%? %% '
precmd() { true }
cs () {
    zle clear-screen
    zle reset-prompt
}
zle -N cs
bindkey '^l' cs
[snap]

Then this:
0 % false
1 % (hit ^l here)
[..screen is cleared..]
0 % echo $?
1
0 %

I thought `reset-prompt' alone was enough, but it's not. Also, this only
happens, when `clear-screen' and `reset-prompt are used in a single
widget. If called separately, this doesn't happen either.

Regards, Frank



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