Skip to content

Commit ef28619

Browse files
bzozBridgeAR
authored andcommitted
test: fix test-tty-get-color-depth
If getTTYfd returns 0, and stdin is not writable (like on Windows), trying to create WriteStream will fail. This commit fixes that by skipping fd 0. PR-URL: #18478 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0c16b18 commit ef28619

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-tty-get-color-depth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { WriteStream } = require('tty');
1010

1111
// Do our best to grab a tty fd.
1212
function getTTYfd() {
13-
const ttyFd = [0, 1, 2, 4, 5].find(tty.isatty);
13+
const ttyFd = [1, 2, 4, 5].find(tty.isatty);
1414
if (ttyFd === undefined) {
1515
try {
1616
return openSync('/dev/tty');

0 commit comments

Comments
 (0)