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

RE: colors & tab completion



> 
> PROMPT="${fg[magenta]}%n${fg[white]}@${fg[green]}%m ${fg[blue]}%C \
> ${fg[white]}%(#.=>.->) "
...
> anyway, that all works fine.  the problem is that when one presses
> tab multiple times to activate automenu, this is what gets
> displayed:
> 
> "username@host directory -> filename.ext1                     ext2"
> 




You need to tell zsh that these are escapes (and not counted in prompt
length calculation):

%{...%}
     Include a string as a literal escape sequence.  The string within
     the braces should not change the cursor position.  Brace pairs can
     nest.

i.e. you need

PROMPT="%{${fg[magenta]}%}...

-andrej



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