chg: trigger colorsmode (proxspace) in direct calls to client

This commit is contained in:
iceman1001 2020-06-24 11:51:00 +02:00
parent a5b406bffa
commit c2df7ed824

View file

@ -641,7 +641,6 @@ finish2:
#if defined(_WIN32)
static bool DetectWindowsAnsiSupport(void) {
bool ret = false;
HKEY hKey = NULL;
bool virtualTerminalLevelSet = false;
bool forceV2Set = false;
@ -681,9 +680,15 @@ static bool DetectWindowsAnsiSupport(void) {
}
RegCloseKey(hKey);
}
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD dwMode = 0;
GetConsoleMode(hOut, &dwMode);
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(hOut, dwMode);
// If both VirtualTerminalLevel and ForceV2 is set, AnsiColor should work
ret = virtualTerminalLevelSet && forceV2Set;
return ret;
return virtualTerminalLevelSet && forceV2Set;
}
#endif