extra-prompt.sh

Serge van Thillo nulleke at hotmail.com
Sun Jul 29 11:01:12 PDT 2007


On Sun, 2007-07-29 at 09:58 -0500, Bruce Dubbs wrote:
> taipan67 wrote:
> > Bruce Dubbs wrote:
> >> David Jensen wrote:
> >>
> >> NORMAL="\[\033[0;39m\]"
> >> RED="\[\033[1;31m\]"
> >> GREEN="\[\033[1;32m\]"
> >>
> >> if [[ ${EUID} == 0 ]] ; then
> >>   PS1="$RED\u [ $NORMAL\w$RED ]\$ $NORMAL"
> >> else
> >>   PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
> >> fi
> >>
> >>   -- Bruce
> >>   
> > I've also stolen coloured PS1 values from my current Gentoo-box, & they 
> > use the '\033' escape-sequence listed above, but in full, not through 
> > variable-names. They also define 'normal' as "\[\033[00m\]" (not sure of 
> > the difference).
> 
I prefer to use vi to enter the escape sequence, I am using
LC_ALL=en_US.UTF-8 as locate definition. When I use the \033 or \e the
positioning of the cursor isn't right, when I use the (CTRL-H esc) in
vi, everything is ok.

Serge




More information about the blfs-dev mailing list