Skip to content

Commit

Permalink
Detect true color set by max_colors
Browse files Browse the repository at this point in the history
Terminals like `xterm-direct` has max_colors set to 16M. They should be treated as supporting true colors.
  • Loading branch information
quark-zju authored and wez committed Nov 4, 2023
1 parent 7590968 commit 3f1a120
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion termwiz/src/caps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ impl Capabilities {
if has_true_color {
ColorLevel::TrueColor
} else if let Some(cap::MaxColors(n)) = db.get::<cap::MaxColors>() {
if n >= 256 {
if n >= 16777216 {
ColorLevel::TrueColor
} else if n >= 256 {
ColorLevel::TwoFiftySix
} else {
ColorLevel::Sixteen
Expand Down

0 comments on commit 3f1a120

Please sign in to comment.