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

Respect the use of the NO_COLOR environment variable #684

Merged
merged 1 commit into from
Oct 9, 2019
Merged

Respect the use of the NO_COLOR environment variable #684

merged 1 commit into from
Oct 9, 2019

Conversation

coderjoe
Copy link
Contributor

@coderjoe coderjoe commented Oct 6, 2019

🌈 An informal standard for disabling color codes across the many command line tools that output terminal color codes has been described at https://no-color.org

Many of the tools that I already use have begun to support the variable, and having it in Thor would eventually allow most of the Ruby ecosystem tools I support to gain the functionality as well.

This PR scratches this itch by implementing NO_COLOR as https://no-color.org defines it:

All command-line software which outputs text with ANSI color added should check for the presence of a NO_COLOR environment variable that, when present (regardless of its value), prevents the addition of ANSI color.

I'm unsure where the correct place to document this functionality might be. I grepped the source for permutations of "color" and "tty" to to cover the existing functionality. I'm happy to adjust this PR to include documentation if preferred. Just let me know if you want it and whether you have a preference for where it should be.

Respect the declaration of the of the NO_COLOR environment variable as a sign
that color output should be suppressed in he tool. This informal
standard is described at https://no-color.org
@rafaelfranca rafaelfranca merged commit e2f13dc into rails:master Oct 9, 2019
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.

None yet

4 participants