Skip to content

Commit 98c121c

Browse files
committed
Detect WezTerm and mark it as undercurl/Smulx capable
1 parent e926518 commit 98c121c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

helix-tui/src/backend/crossterm.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -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+
}
1721
fn 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
}

0 commit comments

Comments
 (0)