Skip to content
Snippets Groups Projects
  1. Jan 21, 2022
    • Lyndon Brown's avatar
      enable windows colour console support · 8799f3d5
      Lyndon Brown authored
      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
      8799f3d5
  2. Jan 20, 2022
  3. Jan 19, 2022
  4. Jan 18, 2022
  5. Jan 17, 2022
Loading