Enable ANSI colors on Windows when ANSICON is set

This enables colors with ConEmu.
pull/2709/head
Joergen Ibsen 7 years ago committed by Jussi Pakkanen
parent 5208e6524c
commit 1db319737d
  1. 6
      mesonbuild/mlog.py

@ -18,8 +18,10 @@ 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()) and \
os.environ.get('TERM') != 'dumb'
if platform.system().lower() == 'windows':
colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('ANSICON')
else:
colorize_console = os.isatty(sys.stdout.fileno()) and os.environ.get('TERM') != 'dumb'
log_dir = None
log_file = None
log_fname = 'meson-log.txt'

Loading…
Cancel
Save