mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
client win10 color support
This commit is contained in:
parent
b1e4e5e0cc
commit
098e0a183f
6 changed files with 28 additions and 697 deletions
|
@ -682,6 +682,34 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
|
||||
session.supports_colors = false;
|
||||
|
||||
#if defined(_WIN32)
|
||||
// Check if windows AnsiColor Support is enabled in the registery
|
||||
// [HKEY_CURRENT_USER\Console]
|
||||
// "VirtualTerminalLevel"=dword:00000001
|
||||
|
||||
HKEY hKey = NULL;
|
||||
|
||||
if(RegOpenKeyA (HKEY_CURRENT_USER,"Console",&hKey) == ERROR_SUCCESS) {
|
||||
DWORD dwType = REG_SZ;
|
||||
BYTE KeyValue[sizeof(dwType)];
|
||||
DWORD len = sizeof(KeyValue);
|
||||
|
||||
if (RegQueryValueEx(hKey,"VirtualTerminalLevel", NULL, &dwType,KeyValue, &len) != ERROR_FILE_NOT_FOUND) {
|
||||
uint8_t i;
|
||||
uint32_t Data = 0;
|
||||
for (i = 0; i < 4; i++)
|
||||
Data += KeyValue[i] << (8 * i);
|
||||
|
||||
if (Data == 1) { // Reg key is set to 1, Ansi Color Enabled
|
||||
session.supports_colors = true;
|
||||
}
|
||||
}
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
session.stdinOnTTY = isatty(STDIN_FILENO);
|
||||
session.stdoutOnTTY = isatty(STDOUT_FILENO);
|
||||
#if defined(__linux__) || (__APPLE__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue