mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-01-26 11:04:33 +00:00
Makefile: Fix regression that prints unnecessary VT100 escape sequences
Since commit 509c424472 (StdIo: Replace uses of KWSys Terminal with StdIo::Print, 2025-05-08, v4.1.0-rc1~151^2~2) we print unnecessary VT100 escape sequences to establish normal text even when not intending to print color. In combination with `CLICOLOR_FORCE=1`, this breaks detection of implicit link information from compiler driver output. Fixes: #27137
This commit is contained in:
parent
a0a9e48f85
commit
914803bf31
@ -1874,7 +1874,7 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string> const& args)
|
||||
|
||||
bool enabled = true;
|
||||
static cm::StdIo::TermAttrSet const noAttrs;
|
||||
cm::StdIo::TermAttrSet attrs = cm::StdIo::TermAttr::Normal;
|
||||
cm::StdIo::TermAttrSet attrs;
|
||||
bool newline = true;
|
||||
std::string progressDir;
|
||||
for (auto const& arg : cmMakeRange(args).advance(2)) {
|
||||
@ -1910,6 +1910,9 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string> const& args)
|
||||
} else if (arg == "--white") {
|
||||
attrs = cm::StdIo::TermAttr::ForegroundWhite;
|
||||
} else if (arg == "--bold") {
|
||||
if (attrs.empty()) {
|
||||
attrs = cm::StdIo::TermAttr::Normal;
|
||||
}
|
||||
attrs |= cm::StdIo::TermAttr::ForegroundBold;
|
||||
} else if (arg == "--no-newline") {
|
||||
newline = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user