Do not colorize output on dumb terminals

Dumb terminal is provided e.g. by Emacs for programs run within it.
pull/1455/head
Michal Sojka 8 years ago committed by Jussi Pakkanen
parent 48d371bd19
commit 1713aef364
  1. 1
      authors.txt
  2. 3
      mesonbuild/mlog.py

@ -67,3 +67,4 @@ Fabio Porcedda
Rodrigo Lourenço
Sebastian Stang
Marc Becker
Michal Sojka

@ -18,7 +18,8 @@ import sys, os, platform, io
information about Meson runs. Some output goes to screen,
some to logging dir and some goes to both."""
colorize_console = platform.system().lower() != 'windows' and os.isatty(sys.stdout.fileno())
colorize_console = platform.system().lower() != 'windows' and os.isatty(sys.stdout.fileno()) and \
os.environ.get('TERM') != 'dumb'
log_dir = None
log_file = None

Loading…
Cancel
Save