fix(coding-agent): fall back to 256color in Terminal.app (#869)

This commit is contained in:
Sviatoslav Abakumov 2026-01-20 17:49:57 +04:00 committed by GitHub
parent 693112e395
commit 236285b390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -166,10 +166,14 @@ function detectColorMode(): ColorMode {
return "truecolor";
}
const term = process.env.TERM || "";
// Only fall back to 256color for truly limited terminals
// Fall back to 256color for truly limited terminals
if (term === "dumb" || term === "" || term === "linux") {
return "256color";
}
// Terminal.app also doesn't support truecolor
if (process.env.TERM_PROGRAM === "Apple_Terminal") {
return "256color";
}
// Assume truecolor for everything else - virtually all modern terminals support it
return "truecolor";
}