diff --git a/interpreter/cling/lib/Interpreter/CIFactory.cpp b/interpreter/cling/lib/Interpreter/CIFactory.cpp index 644a933e638e13056cf49e0a5af904b095d7d6d5..fc056b50e78de9a0206c233ea0c33bdb1bc81fab 100644 --- a/interpreter/cling/lib/Interpreter/CIFactory.cpp +++ b/interpreter/cling/lib/Interpreter/CIFactory.cpp @@ -25,6 +25,7 @@ #include "llvm/Support/TargetSelect.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" +#include "llvm/Support/Process.h" #include <ctime> @@ -114,7 +115,7 @@ namespace cling { //______________________________________ DiagnosticOptions* DefaultDiagnosticOptions = new DiagnosticOptions(); - DefaultDiagnosticOptions->ShowColors = 1; + DefaultDiagnosticOptions->ShowColors = llvm::sys::Process::StandardErrHasColors() ? 1 : 0; TextDiagnosticPrinter* DiagnosticPrinter = new TextDiagnosticPrinter(llvm::errs(), DefaultDiagnosticOptions); llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> DiagIDs(new DiagnosticIDs());