Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: updated color sequences as variables



On Aug 27,  6:06pm, Russell Hoover wrote:
> 
> I've been using a group of colors-put-into variables that someone put on
> this list a while back, which (in the old color-coding scheme) looked like
> this:
> 
> red="%{$(echo -n '\e[1;31m')%}"
> green="%{$(echo -n '\e[1;32m')%}"     etc.,

Take a look at the "colors" function that is included with the zsh 4.0.x
distributions.  Look for "colors" in the index of the texinfo zsh manual,
or read "man zshcontrib".

> Would the coding in the variables translate -- updating to the new color scheme of
> sequences -- to anything like the following?
> 
> red="%{$(\e[1;31m)%}"

You'd want

  red=$'%{\e[1;31m%}'

Or

  autoload colors
  colors
  red="%{${fg[red]}%}"

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author