Update index.js

This commit is contained in:
idanran 2022-12-07 21:36:24 +08:00
parent 45bdd52392
commit 4f407d4440
No known key found for this signature in database
GPG key ID: 6AAA420F30EBA960

View file

@ -138,10 +138,12 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
switch (env.TERM_PROGRAM) {
case 'iTerm.app':
case 'iTerm.app': {
return version >= 3 ? 3 : 2;
case 'Apple_Terminal':
}
case 'Apple_Terminal': {
return 2;
}
// No default
}
}