Skip to content

Cargo doesn't respect CARGO_TERM_COLOR for help messages #13124

@Sindisil

Description

@Sindisil

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-console-outputArea: Terminal output, colors, progress bar, etc.C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions