-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[Console] Add support for NO_COLOR env var #34252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User-level configuration files and per-instance command-line arguments should override $NO_COLOR
I'm no expert here, but if I use --ansi
on the command-line I would be expecting to see color output.
Oh, can you please add the same to |
Good point @johnstevenson - reading more in depth now I also see that this really only applies to color, and not things like backspace characters and other ANSI codes, I am not sure if the intent of the isDecorated is really just about color or about more than that? I see in a few places like ProgressBar, non-decorated output won't use overwrite. In Composer we also assume non-decorated means no support for ANSI characters at all in some places. So I am not so sure if it's the best way here, ideally we'd need a new API for color support independently from ANSI support. I don't know if it's best to lose all ANSI when you set NO_COLOR, or if you rather get colors anyway.. |
I think we shouldn't care about |
Ok updated 👍 |
Oops, sorry, I hadn't realized that. |
Thank you @Seldaek. |
This PR was merged into the 4.4 branch. Discussion ---------- [Console] Add support for NO_COLOR env var | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | License | MIT | Doc PR | Adds support for https://no-color.org/ - ideally this would be considered a bugfix and added to older releases IMO, but submitting as new feature for now. cc @johnstevenson Commits ------- c1b0a8e Add support for NO_COLOR env var
It would be great if this could be listed in the "Libraries supporting NO_COLOR" section at https://no-color.org/ (via https://github.com/jcs/no_color) |
@johnstevenson totally! could you please send a PR? |
Looks good! |
As they want a link to the release notes, maybe we should wait until the 4.4 release to be able to link to the blog post. |
Sorted. |
Adds support for https://no-color.org/ - ideally this would be considered a bugfix and added to older releases IMO, but submitting as new feature for now.
cc @johnstevenson