From c2df7ed824aab8543bd031614cfca70565e6f56a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 24 Jun 2020 11:51:00 +0200 Subject: [PATCH] chg: trigger colorsmode (proxspace) in direct calls to client --- client/src/proxmark3.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index d820e297d..50d7d660b 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -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