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

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

Closed
isaacs opened this issue Feb 16, 2021 · 3 comments · Fixed by sthagen/nodejs-node#101
Closed

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

isaacs opened this issue Feb 16, 2021 · 3 comments · Fixed by sthagen/nodejs-node#101
Labels
cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations. tty Issues and PRs related to the tty subsystem.

Comments

@isaacs
Copy link
Contributor

isaacs commented Feb 16, 2021

  • 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.

@Trott
Copy link
Member

Trott commented Feb 17, 2021

/ping @BridgeAR

@BridgeAR BridgeAR added cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations. tty Issues and PRs related to the tty subsystem. labels Feb 17, 2021
jasnell added a commit to jasnell/node that referenced this issue Feb 22, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: nodejs#37404
@jasnell
Copy link
Member

jasnell commented Feb 22, 2021

PR: #37477

jasnell added a commit to jasnell/node that referenced this issue Feb 23, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: nodejs#37404
jasnell added a commit to jasnell/node that referenced this issue Feb 25, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: nodejs#37404
jasnell added a commit to jasnell/node that referenced this issue Feb 25, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: nodejs#37404
targos pushed a commit that referenced this issue Feb 28, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #37404

PR-URL: #37477
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this issue May 27, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #37404

PR-URL: #37477
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this issue May 30, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #37404

PR-URL: #37477
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this issue Jun 5, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #37404

PR-URL: #37477
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
targos pushed a commit that referenced this issue Jun 11, 2021
Signed-off-by: James M Snell <jasnell@gmail.com>
Fixes: #37404

PR-URL: #37477
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations. tty Issues and PRs related to the tty subsystem.
Projects
None yet
5 participants
@isaacs @jasnell @Trott @BridgeAR and others