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

completion being broken with colored prompts

Hello there,

I use zsh 4.2.0 on FreeBSD.

Lets say I have the following PROMPT set:

PROMPT="^[[33m%m ^[[39m%# "

Colors work fine. The hostname is printed in yellow, the %# and the
Commandline are normal. It gets like:

stronghold % 

But, it seems to me that zle (with the
completion subsystem) loses it's orientation on where the cursor really
is and how long the prompt really is. Let's use the completion for
anything (ie for traversing some directory tree). So I type:

stronghold % ls /usr/src/<TAB>

And the line is messed up:

stronghold % ls /usr/srls /usr/src/
It looks like the zle thinks the end of prompt is now located in the
place I've marked. I've read through documentation, but I couldn't find
any solution (settable option or anything) to make that work properly.
When the prompt gets longer (and more color switches are used), it gets
more and more messed up, until nothing is readable anymore and I have to
type blindly.

The problem is not related to the terminal program (I tried aterm, xterm
and FreeBSD console), nor $TERM variable (tried cons25, xterm, xterm-color
and screen). I've mostly tried that on FreeBSD, but I also see it
Happening (although in a bit different way) on Linux (zsh 4.0.9), so I'm
not sure how FreeBSD-specific it is.

I have also tried putting color sequences in "%{..%}", which changes the
behaviour a bit (ie, the thing ends up in a different place), but does not
solve the problem.

Did I miss something in the documentation?

 -- Jan Srzednicki --=-- wrzask --=-- Winfried --
 -- w@xxxxxxxx --==-- http://violent.dream.vg/ --

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