mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-05 05:39:57 -05: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:
+4
-1
@@ -1874,7 +1874,7 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string> const& args)
|
|||||||
|
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
static cm::StdIo::TermAttrSet const noAttrs;
|
static cm::StdIo::TermAttrSet const noAttrs;
|
||||||
cm::StdIo::TermAttrSet attrs = cm::StdIo::TermAttr::Normal;
|
cm::StdIo::TermAttrSet attrs;
|
||||||
bool newline = true;
|
bool newline = true;
|
||||||
std::string progressDir;
|
std::string progressDir;
|
||||||
for (auto const& arg : cmMakeRange(args).advance(2)) {
|
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") {
|
} else if (arg == "--white") {
|
||||||
attrs = cm::StdIo::TermAttr::ForegroundWhite;
|
attrs = cm::StdIo::TermAttr::ForegroundWhite;
|
||||||
} else if (arg == "--bold") {
|
} else if (arg == "--bold") {
|
||||||
|
if (attrs.empty()) {
|
||||||
|
attrs = cm::StdIo::TermAttr::Normal;
|
||||||
|
}
|
||||||
attrs |= cm::StdIo::TermAttr::ForegroundBold;
|
attrs |= cm::StdIo::TermAttr::ForegroundBold;
|
||||||
} else if (arg == "--no-newline") {
|
} else if (arg == "--no-newline") {
|
||||||
newline = false;
|
newline = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user