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 to disable color output #2728

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

itchyny
Copy link
Contributor

@itchyny itchyny commented Jul 19, 2023

This PR implements NO_COLOR support. The NO_COLOR environment variable is recognized by various command line tools to disable their color output in terminal. See https://no-color.org for the list of commands and example implementation in C. When --color-output (-C) is used, the color output is enabled regardless of the environment variable (as described in https://no-color.org). This PR resolves #2297.

@itchyny itchyny marked this pull request as draft July 19, 2023 00:40
@itchyny itchyny marked this pull request as ready for review July 19, 2023 01:27
@nicowilliams nicowilliams merged commit 0615d49 into jqlang:master Jul 19, 2023
27 checks passed
@andrewrothman
Copy link

Awesome! Thanks for working on this!

@wader
Copy link
Member

wader commented Jul 24, 2023

Should remember to submit jq to https://github.com/jcs/no_color

@ravron ravron mentioned this pull request Sep 8, 2023
@ravron
Copy link
Contributor

ravron commented Sep 8, 2023

Opened PR to add jq to the list: jcs/no_color#255

@wader
Copy link
Member

wader commented Sep 8, 2023

@ravron Thanks!

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

Successfully merging this pull request may close these issues.

[Feature] support no_color env to disable ansi_color output
5 participants