feat(color-console): support ansi colors in console

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers 2025-04-17 14:54:44 -07:00
parent 564f120c22
commit 4a2b5c72dc
No known key found for this signature in database
GPG Key ID: E10E321EB160949B
4 changed files with 11 additions and 5 deletions

View File

@ -155,7 +155,7 @@
#if defined Q_OS_WIN32 #if defined Q_OS_WIN32
#include <windows.h> #include <windows.h>
#include <QStyleHints> #include <QStyleHints>
#include "WindowsConsole.h" #include "console/WindowsConsole.h"
#endif #endif
#define STRINGIFY(x) #x #define STRINGIFY(x) #x

View File

@ -589,8 +589,8 @@ set(ATLAUNCHER_SOURCES
) )
set(LINKEXE_SOURCES set(LINKEXE_SOURCES
WindowsConsole.cpp console/WindowsConsole.cpp
WindowsConsole.h console/WindowsConsole.h
filelink/FileLink.h filelink/FileLink.h
filelink/FileLink.cpp filelink/FileLink.cpp
@ -1164,8 +1164,8 @@ endif()
if(WIN32) if(WIN32)
set(LAUNCHER_SOURCES set(LAUNCHER_SOURCES
WindowsConsole.cpp console/WindowsConsole.cpp
WindowsConsole.h console/WindowsConsole.h
${LAUNCHER_SOURCES} ${LAUNCHER_SOURCES}
) )
endif() endif()

View File

@ -19,6 +19,7 @@
#ifndef WIN32_LEAN_AND_MEAN #ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif #endif
#include "WindowsConsole.h"
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#include <stdio.h> #include <stdio.h>
@ -126,3 +127,5 @@ bool AttachWindowsConsole()
return false; return false;
} }
std::error_code

View File

@ -21,5 +21,8 @@
#pragma once #pragma once
#include <system_error>
void BindCrtHandlesToStdHandles(bool bindStdIn, bool bindStdOut, bool bindStdErr); void BindCrtHandlesToStdHandles(bool bindStdIn, bool bindStdOut, bool bindStdErr);
bool AttachWindowsConsole(); bool AttachWindowsConsole();
std::error_code EnableAnsiSupport();