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

assert,tty: fix indicator and warning #31429

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/internal/tty.js
Original file line number Diff line number Diff line change
@@ -73,7 +73,10 @@ const TERM_ENVS_REG_EXP = [
/^vt100/
];

let warned = false;
function warnOnDeactivatedColors(env) {
if (warned)
return;
let name;
if (env.NODE_DISABLE_COLORS !== undefined)
name = 'NODE_DISABLE_COLORS';
@@ -85,6 +88,7 @@ function warnOnDeactivatedColors(env) {
`The '${name}' env is ignored due to the 'FORCE_COLOR' env being set.`,
'Warning'
);
warned = true;
}
}

7 changes: 0 additions & 7 deletions test/pseudo-tty/test-tty-color-support.out
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(node:*) Warning: The 'NO_COLOR' env is ignored due to the 'FORCE_COLOR' env being set.
(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set.
BridgeAR marked this conversation as resolved.
Show resolved Hide resolved
(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set.
(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set.
(node:*) Warning: The 'NODE_DISABLE_COLORS' env is ignored due to the 'FORCE_COLOR' env being set.
BridgeAR marked this conversation as resolved.
Show resolved Hide resolved