You are not logged in.

#1 2009-03-27 12:56:49

LonelyStar
Member
Registered: 2007-12-09
Posts: 123

zsh cursor position corrupt when using $fg[] for colors and RPROMPT

Hi,

So far, in my zsh prompt, when using color I did something like:

%F{yellow}

in my PROMPT variable.
Now, this seemed to not have worked on some computers (it did not change color, but showed {yellow}).
So I change to using

$fg[yellow]

This works, but currupts my cursor position (it is not at the end of the prompt anymore) when (and only when) I also use RPROMPT.
Can this be corrected? What is the most easier way to define colors that works?

Simple example for prompt that does not work:
PROMPT="$fg[yellow]>"
RPROMPT="$fg[white]($fg[yellow]%T$fg[white])"

Thanks!
Nathan

Offline

#2 2009-03-27 15:12:28

bwalk
Member
Registered: 2007-03-21
Posts: 177

Re: zsh cursor position corrupt when using $fg[] for colors and RPROMPT

Enclose your colors with %{/%}, as in

%{$fg[red]%}

Offline

Board footer

Powered by FluxBB