Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for coloured output #13

Merged
merged 2 commits into from
Sep 27, 2016
Merged

Conversation

Apanatshka
Copy link
Contributor

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

@Apanatshka
Copy link
Contributor Author

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

@BurntSushi
Copy link
Owner

@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
Copy link
Contributor Author

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
Copy link
Owner

@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
Copy link
Owner

@Apanatshka Shall I merge? :-)

@Apanatshka
Copy link
Contributor Author

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

@Apanatshka Apanatshka mentioned this pull request Sep 27, 2016
@BurntSushi BurntSushi merged commit 3c6f8d7 into BurntSushi:master Sep 27, 2016
@BurntSushi
Copy link
Owner

yay thanks!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants