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

Re: can zsh set background color?



Hi Juhapekka ;),

> > One remaining thing I want to accomplish is to set colors specifically
> > for when I'm logged in as root (something subtle like a BRIGHT RED
> > BACKGROUND and a flashing prompt saying YOU ARE ROOT!)

I have this on my /etc/zshenv:

if [[ $USERNAME == root ]]; then
    export PS1=$'[%n@%m] %{\e[0;35m%}[%~] %{\e[0m%}%# '
else
    export PS1=$'[%n@%m] %{\e[0;32m%}[%~] %{\e[0m%}%# '
fi

But it only sets the foreground color. You'll need to put another
escape sequence to change the background too.

regards,

-- 
David Gómez                                      Jabber ID: davidge@xxxxxxxxxx



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