aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--helix-tui/src/backend/crossterm.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs
index 88e70f32..37721e89 100644
--- a/helix-tui/src/backend/crossterm.rs
+++ b/helix-tui/src/backend/crossterm.rs
@@ -52,10 +52,14 @@ impl Default for Capabilities {
impl Capabilities {
/// Detect capabilities from the terminfo database located based
/// on the $TERM environment variable. If detection fails, returns
- /// a default value where no capability is supported.
+ /// a default value where no capability is supported, or just undercurl
+ /// if config.undercurl is set.
pub fn from_env_or_default(config: &EditorConfig) -> Self {
match termini::TermInfo::from_env() {
- Err(_) => Capabilities::default(),
+ Err(_) => Capabilities {
+ has_extended_underlines: config.undercurl,
+ ..Capabilities::default()
+ },
Ok(t) => Capabilities {
// Smulx, VTE: https://unix.stackexchange.com/a/696253/246284
// Su (used by kitty): https://sw.kovidgoyal.net/kitty/underlines