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

Re: [tip] mouse support



On Thu, Nov 11, 2004 at 09:47:02AM -0800, Bart Schaefer wrote:
> On Thu, 11 Nov 2004, Stephane Chazelas wrote:
> 
> > In that new one, I tried to address the tab/newline issue.
> > It tries to calculate the length of the last line of the prompt,
> > it may fail if PS1 contains %%s or %{ %{ ... %} %} or if two
> > consecutive expansions of PS1 may not generate the same thing
> 
> There's some code in Functions/Prompts/prompt_bart_setup in the function
> prompt_bart_precmd that computes the width of prompt strings.  It's been
> specialized to expect to compute only the width of the first line of a
> two-line PS1, but it shouldn't be hard to adapt.

Well the (%%) expansion flag has another problem:

var='%Sfoo%s'
PS1='$var'

In that case, you need to expand first the variables in PS1 or
you'll miss the %S %s visual sequences.

-- 
Stéphane



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