]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
zsh: Colorize stderr.
authorSimon Ruderich <simon@ruderich.org>
Tue, 10 Mar 2009 16:20:58 +0000 (17:20 +0100)
committerSimon Ruderich <simon@ruderich.org>
Tue, 10 Mar 2009 16:20:58 +0000 (17:20 +0100)
Doesn't work all the time but it's very useful.

zsh/rc

diff --git a/zsh/rc b/zsh/rc
index 02c13d15512926b051c89a23bac7f78d4bf68868..8c57d176fdbf509390f290dd467fff3da5516722 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -343,6 +343,11 @@ todo() {
     fi
 }
 
+# Colorize stderr. Very useful when looking for errors. Thanks to
+# http://gentoo-wiki.com/wiki/Zsh
+exec 2>>(while read line; do
+    print '\e[91m'${(q)line}'\e[0m' > /dev/tty; print -n $'\0'; done &)
+
 
 # RUN COMMANDS