{{ message }}
lib: support FORCE_COLOR for non TTY streams#48034
Merged
Merged
Conversation
Collaborator
MoLow
commented
May 16, 2023
| } | ||
|
|
||
| tests.forEach(run); | ||
| tests.forEach((testCase) => test(inspect(testCase.env), () => run(testCase))); |
Member
Author
There was a problem hiding this comment.
tests did not play well when running in parallel. used node:test to run them sequentially
Member
Author
|
/CC @nodejs/util @nodejs/console |
anonrig
reviewed
May 16, 2023
ljharb
approved these changes
May 16, 2023
anonrig
approved these changes
May 17, 2023
benjamingr
approved these changes
May 17, 2023
Collaborator
aduh95
reviewed
May 17, 2023
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Collaborator
This was referenced May 23, 2023
targos
pushed a commit
that referenced
this pull request
May 30, 2023
PR-URL: #48034 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Contributor
|
This broke tests when pulling into v18, so it needs a backport. |
Member
Author
|
@danielleadams It seems |
Member
Author
Contributor
|
Talked to @MoLow offline, but staging branch is ready for backport now. |
MoLow
added a commit
to MoLow/node
that referenced
this pull request
Jul 6, 2023
PR-URL: nodejs#48034 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
MoLow
added a commit
to MoLow/node
that referenced
this pull request
Jul 9, 2023
PR-URL: nodejs#48034 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
MoLow
added a commit
to MoLow/node
that referenced
this pull request
Jul 9, 2023
PR-URL: nodejs#48034 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
MoLow
added a commit
to MoLow/node
that referenced
this pull request
Jul 9, 2023
PR-URL: nodejs#48034 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Member
|
@MoLow Small heads up, this seems to have broken |
Member
Author
|
@addaleax I am not able to reproduce this: |
Member
dgozman
added a commit
to microsoft/playwright
that referenced
this pull request
Mar 25, 2024
This was historically done to make `console.log()` have colors. However, this makes any other code that checks `process.stdout.isTTY` incorrectly assume real TTY support. Node18 and Node20 now respect `FORCE_COLOR=1` in console, so our default behavior of forcing colors in the worker process just works out of the box. See nodejs/node#48034.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The current behavior of
FORCE_COLORis to take effect whenstdout/stderrare TTY'saccording to the documentation:
this PR moves the check for the value of
FORCE_COLORbefore testingisTTY- and extracts the logic to a central utility.Refs: #31409 (comment)