Skip to content

Cargo doesn't respect --color or CARGO_TERM_COLOR for help text and errors from clap #9012

Open
@mchernyavsky

Description

Problem

^title

I expect that with --color=always option (or CARGO_TERM_COLOR=always environment variable) the output will contain expected ANSI escape codes.

Steps

  1. Run cargo build --color=always --unknown &> out.txt
  2. Theout.txt will contain the following output (without ANSI escape codes):
error: Found argument '--unknown' which wasn't expected, or isn't valid in this context

USAGE:
    cargo build --color <WHEN>

For more information try --help

Notes

Output of cargo version:

cargo 1.50.0-nightly (a3c2627fb 2020-12-14)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-console-outputArea: Terminal output, colors, progress bar, etc.C-bugCategory: bugS-needs-team-inputStatus: Needs input from team on whether/how to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions