[ILUG] Colour Prompts
John P. Looney
jplooney-ilug at online.ie
Fri Dec 17 14:21:00 GMT 1999
On Fri, Dec 17, 1999 at 01:58:42PM +0000, Colm Buckley mentioned:
> Look. Grr. This is the Wrong Thing. The Unix terminal interface has
> been carefully crafted over the past 30 years to be independent of any
> particular terminal type; with thousands of hours of effort going into
> libraries like terminfo and curses. Putting terminal-specific codes
> into your prompt (or elsewhere) is gratuitous breakage...
Well said. However, if your prompt is lucirously complex, and you've
forgotten how it works (like me), you can live with just having:
GRAD1='\333\262\261\260'
GRAD2='\260\261\262\333'
YLOBRN='\033[01;33;43m'
WHTBRN='\033[01;37;43m'
REDBRN='\033[00;31;43m'
REDBLK='\033[00;31;40m'
BLKRED='\033[00;37;41m'
PPLBLK='\033[01;35;40m'
WHTBLK='\033[01;37;40m'
NONE='\033[00m'
E='\['
R='\]'
PS1=']2; \u on \h in \w '${E}${WHTBRN}' '${R}${E}${REDBRN}${GRAD2}${BLKRED}' \u : \h : \w/ '${REDBLK}${GRAD1}${WHTBLK}${R}' \d \t '${E}${NONE}' \n'${PPLBLK}${R}'\h ['${?}'] '${E}${NONE}${R}' '
And doing "PS1='% '" if it breaks :)
Kate
Kate
--
Microsoft. The best reason in the world to drink beer.
http://www.redbrick.dcu.ie/~valen
More information about the ILUG
mailing list