Commit cf7bd05 1 parent 46d2378 commit cf7bd05 Copy full SHA for cf7bd05
File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,15 @@ function supportsColor(stream) {
50
50
// libuv that enables 256 color output on Windows. Anything earlier and it
51
51
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
52
52
// release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
53
- // release that supports 256 colors.
53
+ // release that supports 256 colors. Windows 10 build 14931 is the first release
54
+ // that supports 16m/TrueColor.
54
55
const osRelease = os . release ( ) . split ( '.' ) ;
55
56
if (
56
57
Number ( process . versions . node . split ( '.' ) [ 0 ] ) >= 8 &&
57
58
Number ( osRelease [ 0 ] ) >= 10 &&
58
59
Number ( osRelease [ 2 ] ) >= 10586
59
60
) {
60
- return 2 ;
61
+ return Number ( osRelease [ 2 ] ) >= 14931 ? 3 : 2 ;
61
62
}
62
63
63
64
return 1 ;
Original file line number Diff line number Diff line change @@ -295,3 +295,15 @@ test('return level 2 if on Windows 10 build 10586 or later and Node version is >
295
295
const result = importFresh ( '.' ) ;
296
296
t . is ( result . stdout . level , 2 ) ;
297
297
} ) ;
298
+
299
+ test ( 'return level 3 if on Windows 10 build 14931 or later and Node version is >= 8.0.0' , t => {
300
+ Object . defineProperty ( process , 'platform' , {
301
+ value : 'win32'
302
+ } ) ;
303
+ Object . defineProperty ( process . versions , 'node' , {
304
+ value : '8.0.0'
305
+ } ) ;
306
+ os . release = ( ) => '10.0.14931' ;
307
+ const result = importFresh ( '.' ) ;
308
+ t . is ( result . stdout . level , 3 ) ;
309
+ } ) ;
You can’t perform that action at this time.
0 commit comments