Setting colours of text terminals

Alex Satrapa grail at goldweb.com.au
Fri Mar 14 19:05:32 EST 2003


On Friday, March 14, 2003, at 05:23 , Nemo - earth native wrote:

> erm, I've never had to use echo:
>
> PS1=$'%(?.%{\e[0;36m%}.%{\e[1;31m%}%?)^ 
> %{\e[0m%}%m%4(~.%{\e[0;34m%}.%{\e[0m%}):%{\e[0;34m%}%3~ 
> %{\e[0;32m%}%(!.#.$) %{\e[0m%}'

That produces a prompt that is just as cryptic :)  Perhaps some 
difference between 3.0.8 and your version of ZSH?

> Convincing your textmode application (be it the shell, or other) to use 
> colours is usually
> fairly trivial too. (probably less trivial for a shell, as the parody
> of linenoise that is my $PS1 and $RPS1 reveal... ;)

If using "dircolors" to set the $LS_COLORS environment variable, you'll 
need to include a line in your .dircolors file that specifies that your 
$TERM is valid.  Eg, the following is required for my Mac OS X terminal:

...
TERM nsterm
...

Then you should alias "ls" to something like "ls --color=auto" - well, 
that's what I do - others might disagree on this point :)

Alex



More information about the linux mailing list