zsh-workers
 help / color / mirror / code / Atom feed
* colors & tab completion
@ 2001-09-07  8:11 Daniel Lyons
  2001-09-07  8:22 ` Borsenkow Andrej
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Lyons @ 2001-09-07  8:11 UTC (permalink / raw)
  To: zsh-workers

Hi everyone,

I just recently decided to try and make that color prompt I always
wanted, so I eventually came up with this setup (after parsing
/usr/local/share/zsh/3.1.9/colors):

PROMPT="${fg[magenta]}%n${fg[white]}@${fg[green]}%m ${fg[blue]}%C \
${fg[white]}%(#.=>.->) "

this clearly makes this format: "username@host directory -> " with
the username magenta, the host green, and the directory blue.  the
-> becomes => when logged in as root.

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"

where the huge gap appears to be about equal to the length of the
color prompt.

I tried doing this with zsh -f, in case it was my config file, and
it wasn't.  I'm running OpenBSD 2.9 on my personal system, but I
have the same problem on the university computers running a
Slackware variant.  Same problem with zsh versions 3.1.9 and 4.0.2.

any help would be greatly appreciated!  Thank you

Daniel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: colors & tab completion
  2001-09-07  8:11 colors & tab completion Daniel Lyons
@ 2001-09-07  8:22 ` Borsenkow Andrej
  0 siblings, 0 replies; 2+ messages in thread
From: Borsenkow Andrej @ 2001-09-07  8:22 UTC (permalink / raw)
  To: 'Daniel Lyons', zsh-workers

> 
> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-07  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-07  8:11 colors & tab completion Daniel Lyons
2001-09-07  8:22 ` Borsenkow Andrej

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).