Created
November 13, 2018 00:18
-
-
Save nzbart/b138e8342009dc2e51ca322cc7488be0 to your computer and use it in GitHub Desktop.
Configure Windows for ANSI escape sequences to allow colour output in cross-platform manner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void configure_console_for_ansi_escape_sequences() | |
{ | |
auto const console_window = GetStdHandle(STD_OUTPUT_HANDLE); | |
DWORD startup_console_mode; | |
GetConsoleMode(console_window, &startup_console_mode); | |
SetConsoleMode(console_window, startup_console_mode | 0x0004); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment