From 80ac428996a98d3e5fa846d011cdc425d2d6a9ad Mon Sep 17 00:00:00 2001 From: Duncan Healy Date: Wed, 13 Nov 2019 17:59:45 +0000 Subject: tty: truecolor check moved before 256 check 256 color would be return instead of 16m if both env variables were set * tty: improve color check order highest spec first * tty: add test for TERM and COLORTERM set * tty: move COLORTERM check outside TERM closure * tty: remove extra if check for COLORTERM Refs: https://github.com/nodejs/node/issues/27609 PR-URL: https://github.com/nodejs/node/pull/30474 Reviewed-By: Ruben Bridgewater Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/pseudo-tty/test-tty-color-support.js | 1 + 1 file changed, 1 insertion(+) (limited to 'test/pseudo-tty') diff --git a/test/pseudo-tty/test-tty-color-support.js b/test/pseudo-tty/test-tty-color-support.js index b2cfc804c3..57ed640d4d 100644 --- a/test/pseudo-tty/test-tty-color-support.js +++ b/test/pseudo-tty/test-tty-color-support.js @@ -71,6 +71,7 @@ const writeStream = new WriteStream(fd); [{ NO_COLOR: '', COLORTERM: '24bit' }, 1], [{ TMUX: '1', FORCE_COLOR: 0 }, 1], [{ NO_COLOR: 'true', FORCE_COLOR: 0, COLORTERM: 'truecolor' }, 1], + [{ TERM: 'xterm-256color', COLORTERM: 'truecolor' }, 24], ].forEach(([env, depth], i) => { const actual = writeStream.getColorDepth(env); assert.strictEqual( -- cgit v1.2.3