From bf857055c450a63c87c31abf9ada207ef8319148 Mon Sep 17 00:00:00 2001 From: Luis Enrique Chacon Ochoa Date: Fri, 12 Mar 2021 18:05:33 -0800 Subject: [PATCH] Clone Reporter style --- src/AppInstallerCLICore/ExecutionReporter.cpp | 5 +++++ src/AppInstallerCLICore/ExecutionReporter.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/AppInstallerCLICore/ExecutionReporter.cpp b/src/AppInstallerCLICore/ExecutionReporter.cpp index 184ba2cb58..4e4bc298aa 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.cpp +++ b/src/AppInstallerCLICore/ExecutionReporter.cpp @@ -32,6 +32,10 @@ namespace AppInstaller::CLI::Execution Reporter::Reporter(const Reporter& other, clone_t) : Reporter(other.m_out, other.m_in) { + if (other.m_style.has_value()) + { + SetStyle(*other.m_style); + } } OutputStream Reporter::GetOutputStream(Level level) @@ -78,6 +82,7 @@ namespace AppInstaller::CLI::Execution void Reporter::SetStyle(VisualStyle style) { + m_style = style; if (m_spinner) { m_spinner->SetStyle(style); diff --git a/src/AppInstallerCLICore/ExecutionReporter.h b/src/AppInstallerCLICore/ExecutionReporter.h index 559fdc3979..16ae7ba327 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.h +++ b/src/AppInstallerCLICore/ExecutionReporter.h @@ -131,6 +131,7 @@ namespace AppInstaller::CLI::Execution std::ostream& m_out; std::istream& m_in; bool m_isVTEnabled = true; + std::optional m_style; std::optional m_spinner; std::optional m_progressBar; wil::srwlock m_progressCallbackLock;