Closed Apanatshka closed 8 years ago
Gah.. of course it doesn't work on Windows... I'll have to look into that later :(
@Apanatshka While having a test for Windows would be nice, I think you should jetison the idea and put the test behind #[cfg(unix)]
. Coloring on Windows is an absolute nightmare. You need to be actually attached to a Windows console and use its API to make coloring work. It's completely different than just writing ANSI escape codes. (Windows coloring was one of the top 3 most complex things I faced while building ripgrep
, just to give you an idea.)
Yeah, I tried to get colouring on windows and I didn't get anywhere at all 😕
I'll add the #[cfg(unix)]
. I also read that Windows 10 with the latest updates ("Threshold 2"?) does support ANSI escape codes, so this issue will eventually go away. I presume people who are serious about a command-line interface on windows use a separate unix terminal emulator anyway.
@Apanatshka Eh, not necessarily. Plenty of folks use PowerShell. The standard command prompt on Windows 10 also isn't as bad as its predecessors either. But yeah, I'm totally OK with giving up on Windows colors.
@Apanatshka Shall I merge? :-)
Yeah, let's merge and be done with this 👍
yay thanks!
I'll get on the badge hopefully. Maybe this weekend.
It took some figuring out, but here's a test for coloured output :)