From owner-freebsd-questions@FreeBSD.ORG Thu Sep 18 07:06:52 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EAE61065670 for ; Thu, 18 Sep 2008 07:06:52 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from mailout.zetnet.co.uk (mailout.zetnet.co.uk [194.247.47.231]) by mx1.freebsd.org (Postfix) with ESMTP id 17B7B8FC17 for ; Thu, 18 Sep 2008 07:06:51 +0000 (UTC) (envelope-from frank@esperance-linux.co.uk) Received: from irwell.zetnet.co.uk ([194.247.47.48] helo=zetnet.co.uk) by mailout.zetnet.co.uk with esmtp (Exim 4.63) (envelope-from ) id 1KgDbC-000097-MX; Thu, 18 Sep 2008 08:06:46 +0100 Received: from melon.esperance-linux.co.uk (54-144.adsl.zetnet.co.uk [194.247.54.144]) by zetnet.co.uk (8.14.1/8.14.1/Debian-9) with ESMTP id m8I76iaR016890; Thu, 18 Sep 2008 08:06:45 +0100 Received: by melon.esperance-linux.co.uk (Postfix, from userid 1001) id 8730AFCA4AD; Thu, 18 Sep 2008 08:06:39 +0100 (BST) Date: Thu, 18 Sep 2008 08:06:39 +0100 From: Frank Shute To: Anselm Strauss Message-ID: <20080918070639.GA20237@melon.esperance-linux.co.uk> Mail-Followup-To: Anselm Strauss , freebsd-questions@freebsd.org References: <11167f520809172208g655640b0w9a5ad0deb2e44f7e@mail.gmail.com> <544E50BF-EE1B-466A-A152-03AFA7688FAF@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <544E50BF-EE1B-466A-A152-03AFA7688FAF@gmail.com> User-Agent: Mutt/1.4.2.3i X-Face: *}~{PHnDTzvXPe'wl_-f%!@+r5; VLhb':*DsX%wEOPg\fDrXWQJf|2\,92"DdS%63t*BHDyQ|OWo@Gfjcd72eaN!4%NE{0]p)ihQ1MyFNtWL X-Operating-System: FreeBSD 6.3-RELEASE-p2 i386 X-Organisation: 'http://www.shute.org.uk/' X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (zetnet.co.uk [194.247.46.1]); Thu, 18 Sep 2008 08:06:45 +0100 (BST) Cc: freebsd-questions@freebsd.org Subject: Re: bash shell colors X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Frank Shute List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 07:06:52 -0000 On Thu, Sep 18, 2008 at 08:56:09AM +0200, Anselm Strauss wrote: > > 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. > The ANSI color escape codes are shown here: http://www.understudy.net/custom.html#table2 I don't know if they're in any FreeBSD documentation. Regards, -- Frank Contact info: http://www.shute.org.uk/misc/contact.html