Skip to content

Respect color environment variables if set#813

Merged
ericwb merged 1 commit into
PyCQA:mainfrom
ericwb:color
Feb 17, 2022
Merged

Respect color environment variables if set#813
ericwb merged 1 commit into
PyCQA:mainfrom
ericwb:color

Conversation

@ericwb
Copy link
Copy Markdown
Member

@ericwb ericwb commented Feb 14, 2022

According to command line standards [1], a command line should
do its best to honor certain environment variables requesting
whether color should be part of the standard output. Two such
vars include NO_COLOR (if set) and TERM (if set to dumb), when
set tell the CLI to disable color.

[1] https://clig.dev/#output

Partially-fixes #678

Signed-off-by: Eric Brown browne@vmware.com

According to command line standards [1], a command line should
do its best to honor certain environment variables requesting
whether color should be part of the standard output. Two such
vars include NO_COLOR (if set) and TERM (if set to dumb), when
set tell the CLI to disable color.

[1] https://clig.dev/#output

Partially-fixes #678

Signed-off-by: Eric Brown <browne@vmware.com>
@sigmavirus24
Copy link
Copy Markdown
Member

If we switch to Rich, I think it honors this for us

@ericwb ericwb added this to the Release 1.7.3 milestone Feb 16, 2022
@ericwb
Copy link
Copy Markdown
Member Author

ericwb commented Feb 17, 2022

If we switch to Rich, I think it honors this for us

True, but Rich brings in a lot of other function I don't think we need at this time.

@sigmavirus24
Copy link
Copy Markdown
Member

Honestly, I think our formatting could be better done via rich. We can do that in another PR though

@ericwb ericwb merged commit 1691b93 into PyCQA:main Feb 17, 2022
@ericwb ericwb deleted the color branch February 21, 2022 21:35
This was referenced Feb 28, 2022
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.

Conform more to command line standards

2 participants