Skip to content

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

Closed as not planned
@rhysd

Description

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]

Metadata

Assignees

No one assigned

    Labels

    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