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:
@@ -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 } {
|
||||
|
||||
Reference in New Issue
Block a user