mirror of
https://github.com/dlang-community/D-Scanner.git
synced 2025-04-25 21:00:17 +03:00
Only call Win32 API to enable colored output once
This commit is contained in:
parent
b0bb905a40
commit
1201a68f66
1 changed files with 5 additions and 0 deletions
|
@ -163,6 +163,11 @@ void enableColoredOutput()
|
|||
GetConsoleMode, GetStdHandle, HANDLE, INVALID_HANDLE_VALUE,
|
||||
SetConsoleMode, STD_OUTPUT_HANDLE;
|
||||
|
||||
static bool enabledColor = false;
|
||||
if (enabledColor)
|
||||
return;
|
||||
enabledColor = true;
|
||||
|
||||
// Set output mode to handle virtual terminal sequences
|
||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (hOut == INVALID_HANDLE_VALUE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue