summaryrefslogtreecommitdiff
path: root/helix-tui/src/backend/crossterm.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2022-12-02 08:42:10 +0000
committerBlaž Hrastnik2022-12-02 08:42:10 +0000
commit98c121c9fc9d9dbc058120ede9700c0e0bbc5551 (patch)
treef5bb5da0152453c86db1d478087798d11b9743d4 /helix-tui/src/backend/crossterm.rs
parente92651816dea9f28ff2d73b06dedbe03c02ebe30 (diff)
Detect WezTerm and mark it as undercurl/Smulx capable
Diffstat (limited to 'helix-tui/src/backend/crossterm.rs')
-rw-r--r--helix-tui/src/backend/crossterm.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs
index 7c7250fa..c00e1f40 100644
--- a/helix-tui/src/backend/crossterm.rs
+++ b/helix-tui/src/backend/crossterm.rs
@@ -14,6 +14,10 @@ use std::{
fmt,
io::{self, Write},
};
+
+fn term_program() -> Option<String> {
+ std::env::var("TERM_PROGRAM").ok()
+}
fn vte_version() -> Option<usize> {
std::env::var("VTE_VERSION").ok()?.parse().ok()
}
@@ -35,9 +39,11 @@ impl Capabilities {
Ok(t) => Capabilities {
// Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
// 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()
|| t.extended_cap("Su").is_some()
- || vte_version() >= Some(5102),
+ || vte_version() >= Some(5102)
+ || matches!(term_program().as_deref(), Some("WezTerm")),
},
}
}