@@ -565,7 +565,7 @@ impl Terminal { |
| 565 | 2 => self.attrs.dim = true, | 565 | 2 => self.attrs.dim = true, |
| 566 | 3 => self.attrs.italic = true, | 566 | 3 => self.attrs.italic = true, |
| 567 | 4 => { | 567 | 4 => { |
| 568 | - // Underline - check for subparameter | 568 | + // Underline - check for subparameter (SGR 4:N syntax) |
| 569 | if param.len() > 1 { | 569 | if param.len() > 1 { |
| 570 | self.attrs.underline = match param[1] { | 570 | self.attrs.underline = match param[1] { |
| 571 | 0 => UnderlineStyle::None, | 571 | 0 => UnderlineStyle::None, |
@@ -584,7 +584,10 @@ impl Terminal { |
| 584 | 7 => self.attrs.inverse = true, | 584 | 7 => self.attrs.inverse = true, |
| 585 | 8 => self.attrs.hidden = true, | 585 | 8 => self.attrs.hidden = true, |
| 586 | 9 => self.attrs.strikethrough = true, | 586 | 9 => self.attrs.strikethrough = true, |
| 587 | - 21 => self.attrs.underline = UnderlineStyle::Double, | 587 | + // SGR 21: ECMA-48 says "doubly underlined", but many terminal libraries |
| | 588 | + // (crossterm, etc.) send SGR 21 as "bold off" for compatibility. |
| | 589 | + // We follow the common usage for compatibility with TUI apps. |
| | 590 | + 21 => self.attrs.bold = false, |
| 588 | 22 => { | 591 | 22 => { |
| 589 | self.attrs.bold = false; | 592 | self.attrs.bold = false; |
| 590 | self.attrs.dim = false; | 593 | self.attrs.dim = false; |