Merge pull request #56 from anzz1/patch-2

This commit is contained in:
Kevin Kwok 2023-03-18 13:56:08 -07:00 committed by GitHub
commit ad0f01b366
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -887,10 +887,11 @@ int main(int argc, char ** argv) {
sigaction(SIGINT, &sigint_action, NULL); sigaction(SIGINT, &sigint_action, NULL);
#elif defined (_WIN32) #elif defined (_WIN32)
signal(SIGINT, sigint_handler); signal(SIGINT, sigint_handler);
// Windows console ANSI color fix // Windows console ANSI color fix
DWORD mode = 0;
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD mode; if (hConsole && hConsole != INVALID_HANDLE_VALUE && GetConsoleMode(hConsole, &mode))
GetConsoleMode(hConsole, &mode);
SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
#endif #endif