diff options
author | Joergen Ibsen <ji@ibse.dk> | 2017-11-29 14:37:48 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-11-29 23:53:58 +0200 |
commit | 1db319737dd472901be7880510fb7de8c5bd9dc2 (patch) | |
tree | f72a939800eed813a44aa5dcf04593470aac7895 /mesonbuild/mlog.py | |
parent | 5208e6524cef1a4d1107ecc9e41ad6e427604455 (diff) | |
download | meson-1db319737dd472901be7880510fb7de8c5bd9dc2.zip meson-1db319737dd472901be7880510fb7de8c5bd9dc2.tar.gz meson-1db319737dd472901be7880510fb7de8c5bd9dc2.tar.bz2 |
Enable ANSI colors on Windows when ANSICON is set
This enables colors with ConEmu.
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r-- | mesonbuild/mlog.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index 18c1e6a..a0d07ec 100644 --- a/mesonbuild/mlog.py +++ b/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' |