Minor tweaks

This commit is contained in:
Sindre Sorhus 2022-11-17 01:56:01 +07:00
parent 79c56dfc1e
commit a027e3c1e0
5 changed files with 9 additions and 21 deletions

View file

@ -129,10 +129,13 @@ 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
}
}