From 074a6a8cf668e748d6749ac30e58ce07179d5da8 Mon Sep 17 00:00:00 2001 From: Marin Baron Date: Sat, 24 Aug 2019 19:29:18 +0200 Subject: CTest: Add env var CLICOLOR_FORCE to force color output Base impl on `Source/kwsys/Terminal.c:kwsysTerminalStreamIsVT100`. This enables pipes/logs with colors. --- Source/cmCTest.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 866d262..ca39a7b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2125,6 +2125,11 @@ bool cmCTest::ColoredOutputSupportedByConsole() return false; #else // On UNIX we need a non-dumb tty. + std::string clicolor_force; + if (cmSystemTools::GetEnv("CLICOLOR_FORCE", clicolor_force) && + !clicolor_force.empty() && clicolor_force != "0") { + return true; + } return ConsoleIsNotDumb(); #endif } -- cgit v0.12