Skip to content

Commit

Permalink
minor: Fix Windows Legacy Console mode term colors
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Mar 30, 2023
1 parent 128755c commit fe3df68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/term_ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ static void *_term_init(FILE *fp)
GetConsoleMode(console->hnd, &dwMode);
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(console->hnd, dwMode);
// Check if it worked, it will fail for Legacy console-mode
GetConsoleMode (console->hnd, &dwMode);
if (!(dwMode & ENABLE_VIRTUAL_TERMINAL_PROCESSING)) {
console->ansi = 0;
}
}

_term_set_color(console, FALSE, TERM_COLOR_RESET); /* Set 'console->fg' and 'console->bg' */
Expand Down

0 comments on commit fe3df68

Please sign in to comment.