diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-30 15:55:13 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-30 15:55:13 +0300 |
| commit | b7015f17a49501e99642009ebadabcbefc0fbad0 (patch) | |
| tree | d245bcac1ef14e2272e3850d698fcccae1f8c379 /src/pane/xtgettcap.rs | |
| parent | e9bcea9c0da2ebd996b4b570c504582740f3466e (diff) | |
fix: render ansi undercurl styles
refs #895
Diffstat (limited to 'src/pane/xtgettcap.rs')
| -rw-r--r-- | src/pane/xtgettcap.rs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/pane/xtgettcap.rs b/src/pane/xtgettcap.rs index f0a91df5..7d2dfc5d 100644 --- a/src/pane/xtgettcap.rs +++ b/src/pane/xtgettcap.rs @@ -174,8 +174,7 @@ fn xtgettcap_response(cap_hex: &[u8]) -> Option<Bytes> { } fn xtgettcap_value(cap_hex: &[u8]) -> Option<Option<&'static [u8]>> { - // Mirror only the Ghostty terminfo capabilities that this pane path can - // stand behind. Smulx is intentionally absent until underline shapes render. + // Mirror only the Ghostty terminfo capabilities that this pane path can stand behind. match cap_hex { b"5463" => Some(None), b"524742" => Some(Some(b"8")), @@ -183,6 +182,7 @@ fn xtgettcap_value(cap_hex: &[u8]) -> Option<Option<&'static [u8]>> { b"73657472676262" => Some(Some(b"\\E[48:2:%p1%d:%p2%d:%p3%dm")), b"4D73" => Some(Some(b"\\E]52;%p1%s;%p2%s\\007")), b"5375" => Some(None), + b"536D756C78" => Some(Some(b"\\E[4:%p1%dm")), b"536574756C63" => Some(Some( b"\\E[58:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%d%;m", )), @@ -255,12 +255,26 @@ mod tests { fn tracker_ignores_unsupported_capabilities() { let mut tracker = XtgettcapQueryTracker::default(); - tracker.observe(b"\x1bP+q536D756C78;6E6F7065\x1b\\"); + tracker.observe(b"\x1bP+q6E6F7065\x1b\\"); assert!(response_bytes(tracker.drain_pending()).is_empty()); } #[test] + fn tracker_returns_underline_style_capability() { + let mut tracker = XtgettcapQueryTracker::default(); + + tracker.observe(b"\x1bP+q536D756C78\x1b\\"); + + assert_eq!( + response_bytes(tracker.drain_pending()), + vec![Bytes::from_static( + b"\x1bP1+r536D756C78=5C455B343A25703125646D\x1b\\" + )] + ); + } + + #[test] fn tracker_keeps_split_query_until_string_terminator() { let mut tracker = XtgettcapQueryTracker::default(); |
