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

Respect NO_COLORenvironment variable when using styleText #54365

Closed
todor-a opened this issue Aug 14, 2024 · 3 comments · Fixed by #54389
Closed

Respect NO_COLORenvironment variable when using styleText #54365

todor-a opened this issue Aug 14, 2024 · 3 comments · Fixed by #54389
Labels
feature request Issues that request new features to be added to Node.js. util Issues and PRs related to the built-in util module.

Comments

@todor-a
Copy link

todor-a commented Aug 14, 2024

What is the problem this feature will solve?

The styleText utility does not take into account if NO_COLOR is passed. It would be nice if it did.

What is the feature you are proposing to solve the problem?

Before applying styles, check if NO_COLOR is set.

Other tools, like picocolors, look at cli flags as well.

Would be happy to submit a PR.

What alternatives have you considered?

No response

@todor-a todor-a added the feature request Issues that request new features to be added to Node.js. label Aug 14, 2024
@targos
Copy link
Member

targos commented Aug 14, 2024

A PR was started a while ago (but seems stalled): #51959

@todor-a
Copy link
Author

todor-a commented Aug 14, 2024

My bad. Searched through the issues but not through the PRs (rookie mistake).

Should I close this?

@RedYetiDev RedYetiDev added the util Issues and PRs related to the built-in util module. label Aug 16, 2024
@jakecastelli
Copy link
Member

Should I close this?

You don't have to, once this PR lands, it will automatically close this issue as completed.

nodejs-github-bot pushed a commit that referenced this issue Aug 28, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: #54389
Fixes: #54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
RafaelGSS added a commit that referenced this issue Aug 30, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: #54389
Fixes: #54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
RafaelGSS added a commit that referenced this issue Aug 30, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: #54389
Fixes: #54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this issue Sep 22, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: #54389
Fixes: #54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this issue Sep 26, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: #54389
Fixes: #54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
targos pushed a commit that referenced this issue Oct 2, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: #54389
Fixes: #54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
louwers pushed a commit to louwers/node that referenced this issue Nov 2, 2024
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: nodejs#54389
Fixes: nodejs#54365
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Claudio Wunder <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants