diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cc | 6 | ||||
-rw-r--r-- | src/line_printer.cc | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/build.cc b/src/build.cc index a055738..8ef88b5 100644 --- a/src/build.cc +++ b/src/build.cc @@ -139,7 +139,11 @@ void BuildStatus::BuildEdgeFinished(Edge* edge, o != edge->outputs_.end(); ++o) outputs += (*o)->path() + " "; - printer_.PrintOnNewLine("FAILED: " + outputs + "\n"); + if (printer_.supports_color()) { + printer_.PrintOnNewLine("\x1B[31m" "FAILED: " "\x1B[0m" + outputs + "\n"); + } else { + printer_.PrintOnNewLine("FAILED: " + outputs + "\n"); + } printer_.PrintOnNewLine(edge->EvaluateCommand() + "\n"); } 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 |