|
@@ -1925,7 +1925,9 @@ OS_Windows::OS_Windows(HINSTANCE _hInstance) {
|
|
|
// NOTE: The engine does not use ANSI escape codes to color error/warning messages; it uses Windows API calls instead.
|
|
|
// Therefore, error/warning messages are still colored on Windows versions older than 10.
|
|
|
HANDLE stdoutHandle = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
- DWORD outMode = ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
|
|
+ DWORD outMode = 0;
|
|
|
+ GetConsoleMode(stdoutHandle, &outMode);
|
|
|
+ outMode |= ENABLE_PROCESSED_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
|
|
if (!SetConsoleMode(stdoutHandle, outMode)) {
|
|
|
// Windows 8.1 or below, or Windows 10 prior to Anniversary Update.
|
|
|
print_verbose("Can't set the ENABLE_VIRTUAL_TERMINAL_PROCESSING Windows console mode. `print_rich()` will not work as expected.");
|