enable windows colour console support
and thus enable support for: - colour console logging. - colour help text. - colour highlighting of errors and warnings when parsing commandline arguments on windows. according to [1] microsoft provide `isatty()` support under the name `_isatty()` in `io.h` due to it being non-standard. i was originally going to attempt to duplicate the use of the `GetConsoleMode()` function as done in the rust `atty` crate, but the existence of `_isatty()` is much more simple. it's left me confused over why the rust crate uses `GetConsoleMode()` instead. i have not turned up any info so far about when `_isatty()` was introduced on windows, so maybe its too new? maybe it doesn't support special environments like cygwin? i have noted that it was already in use by `src/text/unicode.c`. [1]: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/isatty?view=msvc-170
Showing
- include/vlc_fixups.h 5 additions, 0 deletionsinclude/vlc_fixups.h
- modules/logger/console.c 1 addition, 1 deletionmodules/logger/console.c
- src/config/cmdline.c 1 addition, 4 deletionssrc/config/cmdline.c
- src/config/help.c 0 additions, 6 deletionssrc/config/help.c
- src/text/unicode.c 1 addition, 4 deletionssrc/text/unicode.c
Please register or sign in to comment