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

Re: Fwd: Re: %N in prompt shows "_zsh_highlight_call_widget" on Ctrl-L instead of e.g. "/usr/bin/zsh" or "-zsh" since recently (#414)



On Feb 7,  8:48am, Axel Beckert wrote:
}
} Everytime I press Ctrl-L in my xterm, %N inside my prompt shows
} _zsh_highlight_call_widget instead of e.g. /usr/bin/zsh or -zsh

I'm not sure at which point this might have shown up -- possibly
after workers/38991 (commit f026a4dc) -- but I think it has to be
considered a bugfix, because _zsh_highlight_call_widget (or in the
other example the "clear-screen" widget) is what is being executed
at the time the prompt is recalculated.

Of course in this case you'd really like to know what's happening at
the time the prompt is displayed; %N is really intended for use in PS4
where the recalculation and the display occur together.  For PS1 that
only happens when the editor starts up for each new command input.

In what circumstances would you expect to need %N in PS1?  That is,
the reason to use any %-expando is to display information that will
change after the prompt is assigned.  If there is no case in which
you would expect %N to return something different, then you should
not need to use it.  Instead for example:

    PS1="$ZSH_ARGZERO:t %# "



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