supports-color 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -48,6 +48,10 @@ function supportsColor(stream) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (stream && !stream.isTTY && forceColor !== true) {
|
|
51
|
+
// VS code debugger doesn't have isTTY set
|
|
52
|
+
if (env.VSCODE_PID) {
|
|
53
|
+
return 1;
|
|
54
|
+
}
|
|
51
55
|
return 0;
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -84,14 +88,16 @@ function supportsColor(stream) {
|
|
|
84
88
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
85
89
|
}
|
|
86
90
|
|
|
91
|
+
if (env.COLORTERM === 'truecolor') {
|
|
92
|
+
return 3;
|
|
93
|
+
}
|
|
94
|
+
|
|
87
95
|
if ('TERM_PROGRAM' in env) {
|
|
88
96
|
const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
89
97
|
|
|
90
98
|
switch (env.TERM_PROGRAM) {
|
|
91
99
|
case 'iTerm.app':
|
|
92
100
|
return version >= 3 ? 3 : 2;
|
|
93
|
-
case 'Hyper':
|
|
94
|
-
return 3;
|
|
95
101
|
case 'Apple_Terminal':
|
|
96
102
|
return 2;
|
|
97
103
|
// No default
|