Skip to content

Instantly share code, notes, and snippets.

@cehoffman
cehoffman / colorize.c
Created August 7, 2011 00:04
ZSH STDERR Colorizing
/* $Id: colorize.c 3816 2004-07-03 17:01:32Z lefevre $
*
* Colorize the standard input. Written for zsh stderr coloring.
* This was taken from a mail archive on the subject of colorizing
* the stderr stream in zsh. It was written by Vincent Lefèvre as far
* as I know. It is here so it can be used in a brew formula.
*
* The intended usage is to place a line like the following in your zshrc
* exec 2>>(colorize `tput bold; tput setaf 1` `tput sgr0` > /dev/tty &)
*