Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2008 08:56:09 +0200
From:      Anselm Strauss <amsibamsi@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: bash shell colors
Message-ID:  <544E50BF-EE1B-466A-A152-03AFA7688FAF@gmail.com>
In-Reply-To: <11167f520809172208g655640b0w9a5ad0deb2e44f7e@mail.gmail.com>
References:  <11167f520809172208g655640b0w9a5ad0deb2e44f7e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

I use something like this (heavily inspired by Gentoo):

if [[ ${EUID} == 0 ]] ; then
   PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
   PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
fi

One could maybe also include a check of $TERM for different terminal  
types, not all of them will understand color escape sequences. And of  
course tools like ls and grep do colorized output themselves when  
called with appropriate options.

This is described in the PROMPTING section of Bash's manpage. I did  
not find any documentation for the exact codes for ANSI color escape  
sequences.

Anselm


On Sep 18, 2008, at 07:08 , Sam Fourman Jr. wrote:

> Hello list,
>
> I am looking to configure FreeBSD's Bash
> can anyone post a config file that would make FreeBSD's Bash shell
> color code like the default gentoo bash shell
>
> or if you have a config that you like and feel like posting it I will
> take a look at it.
>
>
> Sam Fourman Jr.
> Fourman Networks




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?544E50BF-EE1B-466A-A152-03AFA7688FAF>