Check if a terminal supports colors on Windows properly

Summary:
Previously we SetUseColor(true) wrongly when output was not a terminal so it broken some (not public) bots.

Thanks for issue report, @stella.stamenova

Reviewers: stella.stamenova, zturner

Reviewed By: stella.stamenova

Subscribers: abidh, lldb-commits, stella.stamenova

Differential Revision: https://reviews.llvm.org/D51772

llvm-svn: 341746
This commit is contained in:
David Bolvansky
2018-09-08 07:15:56 +00:00
parent c96305970d
commit 85dacd1116
2 changed files with 3 additions and 1 deletions

View File

@@ -812,7 +812,6 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
// Enabling use of ANSI color codes because LLDB is using them to highlight
// text.
llvm::sys::Process::UseANSIEscapeCodes(true);
SetUseColor(true);
#endif
}

View File

@@ -806,6 +806,9 @@ void File::CalculateInteractiveAndTerminal() {
if (_isatty(fd)) {
m_is_interactive = eLazyBoolYes;
m_is_real_terminal = eLazyBoolYes;
#if defined(ENABLE_VIRTUAL_TERMINAL_PROCESSING)
m_supports_colors = eLazyBoolYes;
#endif
}
#else
if (isatty(fd)) {