[back] [prev] [next] [index] [root]

 


Colors

Activate or deactivate color mode and customize colors.

Syntax:

Colors(flag);
Colors(s1, ..., sn);
Colors(L);

boolean
  flag  
switch color mode on or off
string
  s1, ..., sn  
resource strings
list
  L  
list of lists of resource strings

Description:

This function can be used to switch on or off a color mode in KASH compatible with ANSI/ISO 6429 standards. The resource strings consist first of one of the strings "normal", "prompt", "command", "result" or "error" to indicate for which type of output a color should be defined. The other strings can be "black", "red", "green", "yellow", "blue", "magenta", "cyan" or "white" and additionally "bold" or "light". The color mode works only for terminals which can display colored letters like " color_xterm" or " rxvt". See the instructions for your terminal. The default colors can be customized via the _ColorTable array. \tt _ColorTable is a list with exacly 5 entries defining (in this order) the "normal", "prompt", "command", "result", "error" colors. Each entry is a list as described in ColorString.


Example:


kash> Colors(true);
kash> Colors("error", "red", "bold");
kash> Colors([ [ "error", "red" ], [ "result", "green", "bold" ] ]);
kash> Colors(false);
> 


<- back[back] [prev] [next] [index] [root]