From d426f1dcc6be2727199f7b37b84e433916bbd1c3 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 29 Aug 2021 13:20:50 -0400 Subject: [PATCH] Remove the blue color workaround for Windows (#330) The illegible blue color has been fixed in Windows 10 build 16257: https://blogs.msdn.microsoft.com/commandline/2017/08/02/updating-the-windows-console-colors/ The workaround causes all kinds of problems, so better to remove it than adding conditionals for older Windows versions. Fixes #329 --- index.js | 5 ----- test/windows.js | 18 +++--------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/index.js b/index.js index 1cc5fa8..2c95ea2 100644 --- a/index.js +++ b/index.js @@ -47,11 +47,6 @@ function Chalk(options) { applyOptions(this, options); } -// Use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001B[94m'; -} - for (const key of Object.keys(ansiStyles)) { ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); diff --git a/test/windows.js b/test/windows.js index 2f2815e..fb21b3d 100644 --- a/test/windows.js +++ b/test/windows.js @@ -28,20 +28,8 @@ test.beforeEach(() => { test('detect a simple term if TERM isn\'t set', t => { delete process.env.TERM; - const m = importFresh('..'); - t.is(m.blue('foo'), '\u001B[94mfoo\u001B[39m'); -}); - -test('replace blue foreground color in cmd.exe', t => { - process.env.TERM = 'dumb'; - const m = importFresh('..'); - t.is(m.blue('foo'), '\u001B[94mfoo\u001B[39m'); -}); - -test('don\'t replace blue foreground color in xterm based terminals', t => { - process.env.TERM = 'xterm-256color'; - const m = importFresh('..'); - t.is(m.blue('foo'), '\u001B[34mfoo\u001B[39m'); + const chalk = importFresh('..'); + t.is(chalk.blue('foo'), '\u001B[34mfoo\u001B[39m'); }); test('don\'t apply dimmed styling on gray strings, see https://github.com/chalk/chalk/issues/58', t => { @@ -59,5 +47,5 @@ test('apply dimmed styling on xterm compatible terminals', t => { test('apply dimmed styling on strings of other colors', t => { process.env.TERM = 'dumb'; const m = importFresh('..'); - t.is(m.blue.dim('foo'), '\u001B[94m\u001B[2mfoo\u001B[22m\u001B[39m'); + t.is(m.blue.dim('foo'), '\u001B[34m\u001B[2mfoo\u001B[22m\u001B[39m'); });