diff --git a/log.py b/log.py index c217e7e..47ea6cb 100644 --- a/log.py +++ b/log.py @@ -8,7 +8,7 @@ YELLOW = "" BOLD = "" PLAIN = "" -if sys.stderr.isatty(): +if sys.stderr.isatty() and (os.environ.get('TERM') or 'dumb') != 'dumb': # ...use ANSI formatting codes. RED = "\x1b[31m" GREEN = "\x1b[32m" diff --git a/minimal/do b/minimal/do index e4b02ae..1d3c94a 100755 --- a/minimal/do +++ b/minimal/do @@ -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')"