Assume truecolor for most terminals (fixes SSH color detection)

Only fall back to 256color for truly limited terminals (dumb, empty, linux).
Virtually all modern terminals support truecolor, no need to be conservative.
This commit is contained in:
Mario Zechner 2026-01-05 20:11:10 +01:00
parent 9c87eeb805
commit b4fb6770e4

View file

@ -166,10 +166,12 @@ function detectColorMode(): ColorMode {
return "truecolor";
}
const term = process.env.TERM || "";
if (term.includes("256color")) {
// Only fall back to 256color for truly limited terminals
if (term === "dumb" || term === "" || term === "linux") {
return "256color";
}
return "256color";
// Assume truecolor for everything else - virtually all modern terminals support it
return "truecolor";
}
function hexToRgb(hex: string): { r: number; g: number; b: number } {