on master help sign in
Detect WezTerm and mark it as undercurl/Smulx capable
commit98c121c9fc9d9dbc058120ede9700c0e0bbc5551 authorBlaž Hrastnik <blaz@mxxn.io> dateFri 2 Dec 2022, 17:42 (4 years ago) parente926518
1 file changed+7−1
helix-tui/src/backend/crossterm.rs+7−1
helix-tui/src/backend/crossterm.rs+7−1
@@ -14,6 +14,10 @@ use std::{
1414 fmt,
1515 io::{self, Write},
1616};
17+
18+fn term_program() -> Option<String> {
19+ std::env::var("TERM_PROGRAM").ok()
20+}
1721fn vte_version() -> Option<usize> {
1822 std::env::var("VTE_VERSION").ok()?.parse().ok()
1923}
@@ -35,9 +39,11 @@ impl Capabilities {
3539 Ok(t) => Capabilities {
3640 // Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
3741 // Su (used by kitty): https://sw.kovidgoyal.net/kitty/underlines
42+ // WezTerm supports underlines but a lot of distros don't properly install it's terminfo
3843 has_extended_underlines: t.extended_cap("Smulx").is_some()
3944 || t.extended_cap("Su").is_some()
40− || vte_version() >= Some(5102),
45+ || vte_version() >= Some(5102)
46+ || matches!(term_program().as_deref(), Some("WezTerm")),
4147 },
4248 }
4349 }