Setting colours of text terminals

Alex Satrapa grail at
Fri Mar 14 17:01:49 EST 2003

On Friday, March 14, 2003, at 02:04 , Michael James wrote:

> Could anyone send me a reference on colourizing text
>  in konsole or any of the modern xterms?

here's how I do colour in zsh:

if [ "$TERM" = "nsterm" -o "$TERM" = "rxvt" -o "$TERM" = "xterm" ] ; then
     # Use window titlebar to display some information
     print -Pn "\e]0;%n@%m: %~\a"
     # Display the new directory when changing directories
     chpwd () {print -Pn "\e]0;%n@%m: %~\a"}
     PS1=`echo -n "%{\\e[33m%}%T [%?|%!]%#%{\e[0m%} "`
     # Generate two-line command prompt
     PS1=`echo -n "%{\\e[33m%}[%n@%m: %~]\r%B%T [%?|%!]%#%b%{\\e[0m%} "`

Note that I use echo, since zsh only accepts certain "escaped" 
characters (eg: %T) in the context of a command line, not a variable 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 151 bytes
Desc: not available
Url :

More information about the linux mailing list