Fix color codes

This commit is contained in:
Krzosa Karol
2023-04-14 21:13:30 +02:00
parent 44b0bededa
commit 542f2e0297
5 changed files with 5 additions and 4 deletions

View File

@@ -215,6 +215,7 @@ os_list_dir(Arena *scratch, Allocator *a, String dir, U32 flags = LIST_NO_FLAGS)
return result;
}
bool GLOBAL_EnabledConsoleColors;
bool os_enable_console_colors() {
// Set output mode to handle virtual terminal sequences
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -223,6 +224,7 @@ bool os_enable_console_colors() {
if (GetConsoleMode(hOut, &dwMode)) {
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
if (SetConsoleMode(hOut, dwMode)) {
GLOBAL_EnabledConsoleColors = true;
return true;
}
else {