BurntSushi / cargo-benchcmp

A small utility to compare Rust micro-benchmarks.
The Unlicense
342 stars 21 forks source link

Added test for coloured output #13

Closed Apanatshka closed 8 years ago

Apanatshka commented 8 years ago

It took some figuring out, but here's a test for coloured output :)

Apanatshka commented 8 years ago

Gah.. of course it doesn't work on Windows... I'll have to look into that later :(

BurntSushi commented 8 years ago

@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.)

Apanatshka commented 8 years ago

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.

BurntSushi commented 8 years ago

@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.

BurntSushi commented 8 years ago

@Apanatshka Shall I merge? :-)

Apanatshka commented 8 years ago

Yeah, let's merge and be done with this 👍

BurntSushi commented 8 years ago

yay thanks!

I'll get on the badge hopefully. Maybe this weekend.