Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: can zsh set background color?
- X-seq: zsh-users 8352
- From: David Gómez <david@xxxxxxxxxxxx>
- To: juhtolv@xxxxxx
- Subject: Re: can zsh set background color?
- Date: Wed, 12 Jan 2005 11:18:28 +0100
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <87llazm6s0.fsf@xxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: juhtolv@xxxxxx, zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <D4174DD1-5E63-11D9-B4A6-000D93AD26C8@xxxxxxxxxxxx> <20050104152041.GP22789@xxxxxxx> <DADB9AA7-5E73-11D9-B4A6-000D93AD26C8@xxxxxxxxxxxx> <CE27C850-5F84-11D9-9601-000A95D2C79E@xxxxxxxxxxxxxxxx> <D53BEA28-6101-11D9-8BE8-000D93AD26C8@xxxxxxxxxxxx> <87llazm6s0.fsf@xxxxxxxxxxxxxxxxxxxx>
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