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

Re: Length of %? in prompt



On Tue, Feb 26, 2002 at 11:21:19AM -0800, Bart Schaefer wrote:
> On Tue, 26 Feb 2002, Ian Lynagh wrote:
> 
> > One more thing...as the first % escapes the second in
> > "%%1v>-->%?---------%<< " it looks like there is no way to change this
> > value on the fly without recreating the prompt - is this correct?
> 
> If you "setopt promptsubst" you can use a variable for the width:

I was trying to avoid this in favour of psvar, but I think it might be
the best way to do this.

I have just a couple more problems. Firstly I can't find a way to have
ANSI escape sequences actually executed when they are passed through
psvar - is this possible?

And secondly with
    "%\$((\$COLUMNS-2))>%{%}k>"
the %{%} appear in the prompt and both
    "%\$((\$COLUMNS-2))>${(%%):-%{$fg_bold[cyan]%\}}k>"
and "%\$((\$COLUMNS-2))>\${(%%):-%{$fg_bold[cyan]%\}}k>"
seem to be counting the length of the ANSI escape sequence in the length
calculation - am I missing something?


Thanks
Ian, who's slowly getting there  :-)



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