Setting colours of text terminals

Alex Satrapa grail at goldweb.com.au
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%} "`
else
     # Generate two-line command prompt
     PS1=`echo -n "%{\\e[33m%}[%n@%m: %~]\r%B%T [%?|%!]%#%b%{\\e[0m%} "`
fi

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

HTH
Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 151 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux/attachments/20030314/2319a2b4/attachment.bin


More information about the linux mailing list