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 NO_COLOR environment variable #105

Merged
merged 2 commits into from
May 24, 2021
Merged

respect NO_COLOR environment variable #105

merged 2 commits into from
May 24, 2021

Conversation

jethrodaniel
Copy link
Contributor

@jethrodaniel jethrodaniel commented May 18, 2020

When NO_COLOR is set to any non-nil value, output is not colorized.

See https://no-color.org/

When `NO_COLOR` is set to any non-nil value, output is not colorized.

See https://no-color.org/
@jethrodaniel jethrodaniel marked this pull request as ready for review May 18, 2020 02:04
@nobu
Copy link
Member

nobu commented May 18, 2020

From that site:

While some developers and users obviously prefer seeing these colors, many users don’t.

Just out of curiosity, how "many users" in percentage?

And are bold and underline included in NO_COLOR?

@jethrodaniel
Copy link
Contributor Author

While some developers and users obviously prefer seeing these colors, many users don’t.

I expect this is a very small amount of people, myself not included. Maybe just one or two crazy people.

And are bold and underline included in NO_COLOR?

My interpretation is that NO_COLOR would not prohibit bold, underline, flashing, etc. It should only prohibit color.

Since so few people use it, feel free to close if you think it will just add more maintenance burden.

I only added it after I saw the --colorize option, and thought, does irb know about NO_COLOR?.

test/irb/test_init.rb Outdated Show resolved Hide resolved
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
@aycabta aycabta merged commit 9c19899 into ruby:master May 24, 2021
@jethrodaniel jethrodaniel deleted the no-color branch May 25, 2021 02:15
ko1 added a commit to ruby/debug that referenced this pull request Jul 8, 2022
irb seems supported `NO_COLOR` so debug.gem also support it.

ref: https://no-color.org/
ref: ruby/irb#105
ko1 added a commit to ruby/debug that referenced this pull request Jul 8, 2022
irb seems supported `NO_COLOR` so debug.gem also support it.

ref: https://no-color.org/
ref: ruby/irb#105
st0012 pushed a commit to ruby-tooling/ruby-debugger that referenced this pull request Jul 10, 2022
irb seems supported `NO_COLOR` so debug.gem also support it.

ref: https://no-color.org/
ref: ruby/irb#105
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants