Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3e579ab

Browse filesBrowse files
MoLowtargos
authored andcommitted
repl: fix NO_COLORS env var is ignored
PR-URL: #51568 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 8c0a257 commit 3e579ab
Copy full SHA for 3e579ab

File tree

Expand file treeCollapse file tree

3 files changed

+7
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-7
lines changed
Open diff view settings
Collapse file

‎lib/repl.js‎

Copy file name to clipboardExpand all lines: lib/repl.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ function REPLServer(prompt,
302302

303303
if (options.terminal && options.useColors === undefined) {
304304
// If possible, check if stdout supports colors or not.
305-
options.useColors = shouldColorize(options.output) || process.env.NODE_DISABLE_COLORS === undefined;
305+
options.useColors = shouldColorize(options.output);
306306
}
307307

308308
// TODO(devsnek): Add a test case for custom eval functions.
Collapse file

‎test/parallel/test-repl-envvars.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-envvars.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { REPL_MODE_SLOPPY, REPL_MODE_STRICT } = require('repl');
1313
const tests = [
1414
{
1515
env: {},
16-
expected: { terminal: true, useColors: true }
16+
expected: { terminal: true, useColors: false }
1717
},
1818
{
1919
env: { NODE_DISABLE_COLORS: '1' },
@@ -29,7 +29,7 @@ const tests = [
2929
},
3030
{
3131
env: { TERM: 'dumb' },
32-
expected: { terminal: true, useColors: true }
32+
expected: { terminal: true, useColors: false }
3333
},
3434
{
3535
env: { TERM: 'dumb', FORCE_COLOR: '1' },
@@ -41,15 +41,15 @@ const tests = [
4141
},
4242
{
4343
env: { NODE_NO_READLINE: '0' },
44-
expected: { terminal: true, useColors: true }
44+
expected: { terminal: true, useColors: false }
4545
},
4646
{
4747
env: { NODE_REPL_MODE: 'sloppy' },
48-
expected: { terminal: true, useColors: true, replMode: REPL_MODE_SLOPPY }
48+
expected: { terminal: true, useColors: false, replMode: REPL_MODE_SLOPPY }
4949
},
5050
{
5151
env: { NODE_REPL_MODE: 'strict' },
52-
expected: { terminal: true, useColors: true, replMode: REPL_MODE_STRICT }
52+
expected: { terminal: true, useColors: false, replMode: REPL_MODE_STRICT }
5353
},
5454
];
5555

Collapse file

‎test/parallel/test-repl-options.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl-options.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ assert.strictEqual(r1.output, stream);
5555
assert.strictEqual(r1.input, r1.inputStream);
5656
assert.strictEqual(r1.output, r1.outputStream);
5757
assert.strictEqual(r1.terminal, true);
58-
assert.strictEqual(r1.useColors, r1.terminal);
58+
assert.strictEqual(r1.useColors, false);
5959
assert.strictEqual(r1.useGlobal, false);
6060
assert.strictEqual(r1.ignoreUndefined, false);
6161
assert.strictEqual(r1.replMode, repl.REPL_MODE_SLOPPY);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.