Skip to content

Please document FORCE_COLOR/NO_COLOR in node -h output #37404

@isaacs

Description

@isaacs
  • Version: 12.20.2, 14.15.5, 15.3.0
  • Platform: Darwin
  • Subsystem: tty

What steps will reproduce the bug?

$ FORCE_COLOR=1 NO_COLOR=1 node -p 1 1 (node:69290) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set. (Use `node --trace-warnings ...` to show where the warning was created) $ node -h | grep COLOR NODE_DISABLE_COLORS set to 1 to disable colors in the REPL

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

Expect node -h to mention that node responds in some way to the NO_COLOR and FORCE_COLOR environment variables.

Documentation specifies that FORCE_COLOR and NO_COLOR can be used to simulate a different color depth terminal, but should identify the logic by which one or the other is preferred, and stipulate that a warning will be generated if both are set.

What do you see instead?

No mention of FORCE_COLOR and NO_COLOR environment variables.

Only limited mention in docs.

Additional information

Handling of NO_COLOR and FORCE_COLOR were added in 273398a3d09, however the documentation does not mention that node will warn if both are set, only that they can be used to simulate a different color depth support level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliIssues and PRs related to the Node.js command line interface.docIssues and PRs related to the documentations.ttyIssues and PRs related to the tty subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions