mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
Merge topic 'stdio-terminal'
914803bf31Makefile: Fix regression that prints unnecessary VT100 escape sequencesa0a9e48f85StdIo: Fix Terminal abstraction to avoid unnecessary VT100 escape sequences Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !11080
This commit is contained in:
@@ -141,9 +141,13 @@ void Print(OStream& os, TermAttrSet const& attrs,
|
||||
f(os.IOS());
|
||||
break;
|
||||
case TermKind::VT100:
|
||||
SetVT100Attrs(os.IOS(), attrs);
|
||||
f(os.IOS());
|
||||
SetVT100Attrs(os.IOS(), TermAttr::Normal);
|
||||
if (!attrs.empty()) {
|
||||
SetVT100Attrs(os.IOS(), attrs);
|
||||
f(os.IOS());
|
||||
SetVT100Attrs(os.IOS(), TermAttr::Normal);
|
||||
} else {
|
||||
f(os.IOS());
|
||||
}
|
||||
break;
|
||||
#ifdef _WIN32
|
||||
case TermKind::Console: {
|
||||
|
||||
@@ -1923,7 +1923,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)) {
|
||||
@@ -1959,6 +1959,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;
|
||||
|
||||
Reference in New Issue
Block a user