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

Cargo doesn't respect CARGO_TERM_COLOR for help messages #13124

Closed
Sindisil opened this issue Dec 6, 2023 · 3 comments
Closed

Cargo doesn't respect CARGO_TERM_COLOR for help messages #13124

Sindisil opened this issue Dec 6, 2023 · 3 comments
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@Sindisil
Copy link

Sindisil commented Dec 6, 2023

Problem

I always run with CARGO_TERM_COLOR=never, as I find colorized output very hard to read, nearly impossible to read with default term colors on many systems (both Windows & Linux), and of negligible value even if I tweak the default term colors.

Color enable/disable for cargo sub-commands is all over the map, which I understand, since each sub-command is responsible for implementing a "--color" option and/or reading and respecting CARGO_TERM_COLOR. However, even cargo itself is ignoring color preferences, at least in help. I've tried in both:

cargo version
cargo 1.74.0 (ecb9851 2023-10-18)

and

cargo version
cargo 1.76.0-nightly (623b788 2023-12-02)

image

Steps

  1. Set CARGO_TERM_COLOR=never
  2. Run the command "cargo help"
  3. Observe that the help message is colorized.

Possible Solution(s)

No response

Notes

No response

Version

Happens with both

>cargo version --verbose
cargo 1.74.0 (ecb9851af 2023-10-18)
release: 1.74.0
commit-hash: ecb9851afd3095e988daaa35a48bc7f3cb748e04
commit-date: 2023-10-18
host: x86_64-pc-windows-msvc
libgit2: 1.7.1 (sys:0.18.0 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:Schannel)
os: Windows 10.0.22621 (Windows 11 Professional) [64-bit]

and

>cargo version --verbose
cargo 1.76.0-nightly (623b78849 2023-12-02)
release: 1.76.0-nightly
commit-hash: 623b788496b3e51dc2f9282373cf0f6971a229b5
commit-date: 2023-12-02
host: x86_64-pc-windows-msvc
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:Schannel)
os: Windows 10.0.22621 (Windows 11 Professional) [64-bit]
@Sindisil Sindisil added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Dec 6, 2023
@weihanglo
Copy link
Member

See #13052 and #9012, and we track that in #9012. Cargo respects NO_COLOR=1 btw.

@weihanglo weihanglo added the A-console-output Area: Terminal output, colors, progress bar, etc. label Dec 6, 2023
@Sindisil
Copy link
Author

Sindisil commented Dec 6, 2023

Cargo respects NO_COLOR=1 btw.

So it does! That's great news. I'll add that to my profiles.

Not sure how I missed 13052 when I checked to see if this was already reported (I saw 9012, but wasn't sure it was the same issue).

Thanks!

@weihanglo
Copy link
Member

Thanks. I'll close this in favor of #9012. Probably tweak the issue title to make it more obvious.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. 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