diff options
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 55492d36..35a46549 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -768,6 +768,8 @@ pub enum Attr { Underline, /// Underlined twice. DoubleUnderline, + /// Underlined twice. + Undercurl, /// Blink cursor slowly. BlinkSlow, /// Blink cursor fast. @@ -798,6 +800,8 @@ pub enum Attr { Foreground(Color), /// Set indexed background color. Background(Color), + /// Set indexed special color (for underlines). + Special(Color), } /// Identifiers which can be assigned to a graphic character set. @@ -1316,6 +1320,7 @@ fn attrs_from_sgr_parameters(params: &mut ParamsIter<'_>) -> Vec<Option<Attr>> { [3] => Some(Attr::Italic), [4, 0] => Some(Attr::CancelUnderline), [4, 2] => Some(Attr::DoubleUnderline), + [4, 3] => Some(Attr::Undercurl), [4, ..] => Some(Attr::Underline), [5] => Some(Attr::BlinkSlow), [6] => Some(Attr::BlinkFast), @@ -1370,6 +1375,14 @@ fn attrs_from_sgr_parameters(params: &mut ParamsIter<'_>) -> Vec<Option<Attr>> { parse_sgr_color(&mut iter).map(Attr::Background) }, [49] => Some(Attr::Background(Color::Named(NamedColor::Background))), + [58, params @ ..] => { + let rgb_start = if params.len() > 4 { 2 } else { 1 }; + let rgb_iter = params[rgb_start..].iter().copied(); + let mut iter = iter::once(params[0]).chain(rgb_iter); + + parse_sgr_color(&mut iter).map(Attr::Special) + }, + [59] => Some(Attr::Special(Color::Named(NamedColor::Foreground))), [90] => Some(Attr::Foreground(Color::Named(NamedColor::BrightBlack))), [91] => Some(Attr::Foreground(Color::Named(NamedColor::BrightRed))), [92] => Some(Attr::Foreground(Color::Named(NamedColor::BrightGreen))), |