fix(terminal): use ITU T.418 format for emitted CSI 58 sequences (#3440)

This commit is contained in:
tranzystorekk 2024-06-21 13:46:17 +02:00 committed by GitHub
parent 0a0e062e6b
commit 475dd08623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -619,10 +619,10 @@ impl Display for CharacterStyles {
if let Some(ansi_code) = self.underline_color {
match ansi_code {
AnsiCode::RgbCode((r, g, b)) => {
write!(f, "\u{1b}[58;2;{};{};{}m", r, g, b)?;
write!(f, "\u{1b}[58:2::{}:{}:{}m", r, g, b)?;
},
AnsiCode::ColorIndex(color_index) => {
write!(f, "\u{1b}[58;5;{}m", color_index)?;
write!(f, "\u{1b}[58:5:{}m", color_index)?;
},
AnsiCode::Reset => {
write!(f, "\u{1b}[59m")?;