gardesk/garterm / 7266fef

Browse files

fix: treat SGR 21 as bold-off for TUI app compatibility

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
7266fefdd6fec0dc11b26b459bee24bd1d10eee5
Parents
82be9c3
Tree
788d73e

1 changed file

StatusFile+-
M garterm/src/terminal/mod.rs 5 2
garterm/src/terminal/mod.rsmodified
@@ -565,7 +565,7 @@ impl Terminal {
565565
                 2 => self.attrs.dim = true,
566566
                 3 => self.attrs.italic = true,
567567
                 4 => {
568
-                    // Underline - check for subparameter
568
+                    // Underline - check for subparameter (SGR 4:N syntax)
569569
                     if param.len() > 1 {
570570
                         self.attrs.underline = match param[1] {
571571
                             0 => UnderlineStyle::None,
@@ -584,7 +584,10 @@ impl Terminal {
584584
                 7 => self.attrs.inverse = true,
585585
                 8 => self.attrs.hidden = true,
586586
                 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,
588591
                 22 => {
589592
                     self.attrs.bold = false;
590593
                     self.attrs.dim = false;