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

Re: Colorizing the output of watch



On Aug 11, 10:25am, Russell Hoover wrote:
}
} export WATCHFMT="       %D       [%B%t%b]       %B%n%b \
} %(a:%Blogged on%b:logged off)       %B%l%b       from       %B%M%b"
} 
} But I don't know how to put this text in color. It would be great to
} have "logged on" appear in green, say, and "logged off" in, say, blue
} or some other color.

In the very latest zsh you can replace %B with %F{green} and %b with %f.

In most currently-available zsh you'll have to

autoload -U colors
colors

and then replace %B with %{${fg[green]}%} and %b with %{${fg[none]}%}.



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