From 4a2b5c72dc75e03695566af399c504c19170d042 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 17 Apr 2025 14:54:44 -0700 Subject: [PATCH] feat(color-console): support ansi colors in console Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/Application.cpp | 2 +- launcher/CMakeLists.txt | 8 ++++---- launcher/{ => console}/WindowsConsole.cpp | 3 +++ launcher/{ => console}/WindowsConsole.h | 3 +++ 4 files changed, 11 insertions(+), 5 deletions(-) rename launcher/{ => console}/WindowsConsole.cpp (99%) rename launcher/{ => console}/WindowsConsole.h (93%) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index d773d9a1c..f98112641 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -155,7 +155,7 @@ #if defined Q_OS_WIN32 #include #include -#include "WindowsConsole.h" +#include "console/WindowsConsole.h" #endif #define STRINGIFY(x) #x diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 30d657f9e..5d757a130 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -589,8 +589,8 @@ set(ATLAUNCHER_SOURCES ) set(LINKEXE_SOURCES - WindowsConsole.cpp - WindowsConsole.h + console/WindowsConsole.cpp + console/WindowsConsole.h filelink/FileLink.h filelink/FileLink.cpp @@ -1164,8 +1164,8 @@ endif() if(WIN32) set(LAUNCHER_SOURCES - WindowsConsole.cpp - WindowsConsole.h + console/WindowsConsole.cpp + console/WindowsConsole.h ${LAUNCHER_SOURCES} ) endif() diff --git a/launcher/WindowsConsole.cpp b/launcher/console/WindowsConsole.cpp similarity index 99% rename from launcher/WindowsConsole.cpp rename to launcher/console/WindowsConsole.cpp index 83cad5afa..f388bd3b1 100644 --- a/launcher/WindowsConsole.cpp +++ b/launcher/console/WindowsConsole.cpp @@ -19,6 +19,7 @@ #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif +#include "WindowsConsole.h" #include #include #include @@ -126,3 +127,5 @@ bool AttachWindowsConsole() return false; } + +std::error_code diff --git a/launcher/WindowsConsole.h b/launcher/console/WindowsConsole.h similarity index 93% rename from launcher/WindowsConsole.h rename to launcher/console/WindowsConsole.h index ab53864b4..4c1f3ee28 100644 --- a/launcher/WindowsConsole.h +++ b/launcher/console/WindowsConsole.h @@ -21,5 +21,8 @@ #pragma once +#include + void BindCrtHandlesToStdHandles(bool bindStdIn, bool bindStdOut, bool bindStdErr); bool AttachWindowsConsole(); +std::error_code EnableAnsiSupport();