zsh-users
 help / color / mirror / code / Atom feed
* updated color sequences as variables
@ 2001-08-27 22:06 Russell Hoover
  2001-08-27 23:41 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Russell Hoover @ 2001-08-27 22:06 UTC (permalink / raw)
  To: zsh-users

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.,


and could be used (i.e., in a prompt) like this:

export prompt="$yellow($blue%n$yellow<$cyan@$yellow>$red%m$yellow($green%/$yellow)$red-$yellow> $white"

Would the coding in the variables translate -- updating to the new color scheme of
sequences -- to anything like the following?

red="%{$(\e[1;31m)%}"

if not, what would make sense here, and how would it be put into a prompt
string?  I'd like to continue using a system like this, it makes creating
a prompt much easier.

-- 
                                 // rj@panix.com //
    City cops & state cops & national guard & bureau cops & tv cops & movie cops
     & uniform & plainclothes cops & riot cops & cops on top of cops on top of
          cops on top of cops: it's a world full of cops.     -- Paleface


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: updated color sequences as variables
  2001-08-27 22:06 updated color sequences as variables Russell Hoover
@ 2001-08-27 23:41 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2001-08-27 23:41 UTC (permalink / raw)
  To: Russell Hoover, zsh-users

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   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-27 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-27 22:06 updated color sequences as variables Russell Hoover
2001-08-27 23:41 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).