mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-11-28 12:42:09 +03:00
Detect WezTerm and mark it as undercurl/Smulx capable
This commit is contained in:
parent
e92651816d
commit
98c121c9fc
@ -14,6 +14,10 @@ use std::{
|
|||||||
fmt,
|
fmt,
|
||||||
io::{self, Write},
|
io::{self, Write},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fn term_program() -> Option<String> {
|
||||||
|
std::env::var("TERM_PROGRAM").ok()
|
||||||
|
}
|
||||||
fn vte_version() -> Option<usize> {
|
fn vte_version() -> Option<usize> {
|
||||||
std::env::var("VTE_VERSION").ok()?.parse().ok()
|
std::env::var("VTE_VERSION").ok()?.parse().ok()
|
||||||
}
|
}
|
||||||
@ -35,9 +39,11 @@ impl Capabilities {
|
|||||||
Ok(t) => Capabilities {
|
Ok(t) => Capabilities {
|
||||||
// Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
|
// Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
|
||||||
// Su (used by kitty): https://sw.kovidgoyal.net/kitty/underlines
|
// Su (used by kitty): https://sw.kovidgoyal.net/kitty/underlines
|
||||||
|
// WezTerm supports underlines but a lot of distros don't properly install it's terminfo
|
||||||
has_extended_underlines: t.extended_cap("Smulx").is_some()
|
has_extended_underlines: t.extended_cap("Smulx").is_some()
|
||||||
|| t.extended_cap("Su").is_some()
|
|| t.extended_cap("Su").is_some()
|
||||||
|| vte_version() >= Some(5102),
|
|| vte_version() >= Some(5102)
|
||||||
|
|| matches!(term_program().as_deref(), Some("WezTerm")),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user