- keep ENABLE_VIRTUAL_TERMINAL_PROCESSING mode in isolated console mode

This commit is contained in:
Rachael Alexanderson 2024-10-16 06:03:26 -04:00
parent fcf65bee27
commit 2a8b629a12
No known key found for this signature in database
GPG key ID: 26A8ACCE97115EE0

View file

@ -194,7 +194,13 @@ int DoMain (HINSTANCE hInstance)
if (isConsoleApp())
{
StdOut = GetStdHandle(STD_OUTPUT_HANDLE);
FancyStdOut = IsWindows10OrGreater(); // Windows 8.1 and lower do not understand ANSI formatting.
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
DWORD mode;
if (SetConsoleMode(StdOut, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING))
FancyStdOut = IsWindows10OrGreater(); // Windows 8.1 and lower do not understand ANSI formatting.
}
else if (Args->CheckParm("-stdout") || Args->CheckParm("-norun"))
{