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

--help doesn't respect --color never nor CARGO_TERM_COLOR=never #13052

Closed
rhysd opened this issue Nov 27, 2023 · 2 comments
Closed

--help doesn't respect --color never nor CARGO_TERM_COLOR=never #13052

rhysd opened this issue Nov 27, 2023 · 2 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@rhysd
Copy link
Contributor

rhysd commented Nov 27, 2023

Problem

From Rust 1.74, cargo colorizes outputs of help document. However the colors cannot be disabled by --color never argument nor CARGO_TERM_COLOR=never environment variable.

Steps

  1. Run cargo --help --color never
  2. Run CARGO_TERM_COLOR=never cargo --help

Possible Solution(s)

Respect the command line option and the environment variable. When they are set never stop colorizing help outputs.

Notes

Current workaround is NO_COLOR=1 cargo but this disables colors globally.

Version

cargo 1.74.0 (ecb9851af 2023-10-18)
release: 1.74.0
commit-hash: ecb9851afd3095e988daaa35a48bc7f3cb748e04
commit-date: 2023-10-18
host: x86_64-apple-darwin
libgit2: 1.7.1 (sys:0.18.0 vendored)
libcurl: 8.1.2 (sys:0.4.68+curl-8.4.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Mac OS 13.6.0 [64-bit]
@rhysd rhysd added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Nov 27, 2023
@weihanglo
Copy link
Member

Thanks for the report.
It looks like pretty much the same as #9012 and share the same root cause. Should close this and favor #9012?

Some related contexts in #12578 (comment) as well.

@rhysd
Copy link
Contributor Author

rhysd commented Nov 27, 2023

Thanks for your triage. It looks the same. Feel free to close this as duplicate.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants