zsh-users
 help / color / mirror / code / Atom feed
From: "David Gómez" <david@pleyades.net>
To: juhtolv@iki.fi
Cc: zsh-users@sunsite.dk
Subject: Re: can zsh set background color?
Date: Wed, 12 Jan 2005 11:18:28 +0100	[thread overview]
Message-ID: <20050112101828.GA9001@fargo> (raw)
In-Reply-To: <87llazm6s0.fsf@heresy.ainola.jyu.fi>

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@jabber.org


  reply	other threads:[~2005-01-12 10:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-04 15:18 Timothy Luoma
2005-01-04 15:20 ` Mads Martin Joergensen
2005-01-04 17:12   ` Timothy Luoma
2005-01-06  1:46     ` lists
2005-01-07 23:14       ` Timothy Luoma
2005-01-12  7:43         ` Juhapekka Tolvanen
2005-01-12 10:18           ` David Gómez [this message]
2005-01-04 16:55 ` Bart Schaefer
2005-01-04 17:04   ` Timothy Luoma
2005-01-05  3:50 ` Drew Perttula
2005-01-05  9:29   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050112101828.GA9001@fargo \
    --to=david@pleyades.net \
    --cc=juhtolv@iki.fi \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).