log.py, minimal/do: don't use ansi colour codes if $TERM is blank or 'dumb'

Apparently emacs sets TERM=dumb in its tty simulator, so even though
isatty() returns true, we shouldn't use colour codes.  (emacs is therefore
lame. But we knew that.)
This commit is contained in:
Avery Pennarun 2011-01-04 14:11:29 -08:00
commit f6ea1fd76b
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ GREEN=""
BOLD=""
PLAIN=""
if tty <&2 >/dev/null 2>&1; then
if [ -n "$TERM" -a "$TERM" != "dumb" ] && tty <&2 >/dev/null 2>&1; then
GREEN="$(printf '\033[32m')"
BOLD="$(printf '\033[1m')"
PLAIN="$(printf '\033[m')"