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)



Hi again,

On Tue, Feb 14, 2017 at 04:32:30PM +0100, Axel Beckert wrote:
> On Fri, Feb 10, 2017 at 09:59:49AM -0800, Bart Schaefer wrote:
> > 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
> […]
> > 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.
> 
> You're right. The main issue is probably that I wrote that part years
> ago and was surprised that its behaviour changed. But I can't remember
> anymore why I've chosen %N over $0.

I now know again…

> Will replace it with $0 and see if that works out as expected.

That's worse: Now the prompt _always_ shows
"/home/abe/.zsh/zsh.d/15-prompt" (which is the sourced file where the
PS1 assigning happens) instead of e.g. "/usr/bin/zsh". So that needs
some more fine-tuning.

$ZSH_NAME seems close, except that it doesn't show "su" if the shell
was spawned by using "su" (neglectable) and that it doesn't show the
leading dash if it's a login shell.

What I was looking for seems to be $ZSH_ARGZERO. So far that works
fine. I hope, it's backwards compatible to at least 4.3.9 from Debian
7 Wheezy. :-)

		Kind regards, Axel
-- 
/~\  Plain Text Ribbon Campaign                   | Axel Beckert
\ /  Say No to HTML in E-Mail and News            | abe@xxxxxxxxxxxxxxx  (Mail)
 X   See http://www.nonhtmlmail.org/campaign.html | abe@xxxxxxxxx (Mail+Jabber)
/ \  I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)



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