Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ~ avoid panic if running on early windows without ANSI escape con…
…sole support .# Discussion Versions of Windows prior to one of the v1511 Windows 10 builds (likely 10.0.10586.589; released on 2016-09-13) do not have built-in console interpretation of ANSI escapes. After Win10 v1511, ANSI escape interpretation is available, when enabled via `SetConsoleMode()` (see [4]). Earlier versions (back through Windows 7 to XP) *do* have 8-bit color available via the Console API, but it's more cumbersome to access (especially from the `rust` realm)[5]. Pre-ANSI escape color may be too cumbersome to use, but the majority of `pastel` has usefulness even if not displayed in color. "colorcheck" and "pick" are obvious sub-commands which are unusable without some color support and so both are disabled with an error message. "format" and "list" are modified to only display non-colorized output. "paint", a judgement call about error vs un-colorized, is left operational but without colorized output. [1] [MS ~ Release Blog Post](https://devblogs.microsoft.com/commandline/24-bit-color-in-the-windows-console) @@ <https://archive.is/6UTBA> [2] [Reddit ~ Win 10 ANSI Escapes](https://www.reddit.com/r/Windows10/comments/44czox/windows_10_v1511_adds_support_for_ansi_escape) @@ <https://archive.is/7l6tz> [3] [MS TechNet Win 10 Versions](https://docs.microsoft.com/en-us/windows/release-information/) @@ <https://archive.is/sv3LN> [4] [`ansi-term` ~ enable ANSI](https://github.com/rivy/rust.ansi-term/blob/ff7eba98d55ad609c7fcc8c7bb0859b37c7545cc/src/windows.rs#L25-L57) [5] [rust-users ~ Windows color](https://users.rust-lang.org/t/colored-terminal-output/24604/12) @@ <https://web.archive.org/web/20190905231230/https://users.rust-lang.org/t/colored-terminal-output/24604/12>
- Loading branch information