From b7015f17a49501e99642009ebadabcbefc0fbad0 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Tue, 30 Jun 2026 15:55:13 +0300 Subject: fix: render ansi undercurl styles refs #895 --- src/ghostty/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ghostty') diff --git a/src/ghostty/mod.rs b/src/ghostty/mod.rs index 3800ab49..8a909b8c 100644 --- a/src/ghostty/mod.rs +++ b/src/ghostty/mod.rs @@ -353,6 +353,7 @@ pub struct CellStyle { pub invisible: bool, pub strikethrough: bool, pub overline: bool, + pub underline: u8, pub underlined: bool, } @@ -370,11 +371,19 @@ impl From for CellStyle { invisible: value.invisible, strikethrough: value.strikethrough, overline: value.overline, + underline: normalize_underline_style(value.underline), underlined: value.underline != 0, } } } +fn normalize_underline_style(value: std::os::raw::c_int) -> u8 { + match value { + 0..=5 => value as u8, + _ => 1, + } +} + fn cell_color_from_style_color(color: ffi::GhosttyStyleColor) -> Option { match color.tag { ffi::GhosttyStyleColorTag_GHOSTTY_STYLE_COLOR_PALETTE => { -- cgit v1.2.3