diff options
author | Jan Niklas Hasse <jhasse@bixense.com> | 2019-08-02 13:04:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-02 13:04:39 (GMT) |
commit | 70c8d75055b4fcb0ee6d9a41b908c554534725f6 (patch) | |
tree | dbde439bdc7fbd066454e9b8c8cd80c3b27240aa /src/line_printer.cc | |
parent | 20af31d586c1f1bddeaad0583adc17933d5465ce (diff) | |
parent | 85038a5947183e0ead7bd81d7b481228e1e0d13a (diff) | |
download | Ninja-70c8d75055b4fcb0ee6d9a41b908c554534725f6.zip Ninja-70c8d75055b4fcb0ee6d9a41b908c554534725f6.tar.gz Ninja-70c8d75055b4fcb0ee6d9a41b908c554534725f6.tar.bz2 |
Merge pull request #1508 from mqudsi/colored_fail
Emit "FAILED: " in red if terminal supports ANSI color output
Diffstat (limited to 'src/line_printer.cc')
-rw-r--r-- | src/line_printer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/line_printer.cc b/src/line_printer.cc index 55469d9..c93173e 100644 --- a/src/line_printer.cc +++ b/src/line_printer.cc @@ -58,7 +58,9 @@ LinePrinter::LinePrinter() : have_blank_line_(true), console_locked_(false) { if (supports_color_) { DWORD mode; if (GetConsoleMode(console_, &mode)) { - SetConsoleMode(console_, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); + if (!SetConsoleMode(console_, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING)) { + supports_color_ = false; + } } } #endif |