csi: implement SGR 21, double underlines

This commit is contained in:
Daniel Eklöf 2024-07-02 07:45:04 +02:00
parent 970b95509c
commit e708d19ea3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 10 additions and 1 deletions

View file

@ -62,6 +62,7 @@
reduces the memory usage, but should also be slightly faster.
* Support for high-res mouse wheel scroll events ([#1738][1738]).
* Styled and colored underlines ([#828][828]).
* Support for SGR 21 (double underline).
[1707]: https://codeberg.org/dnkl/foot/issues/1707
[1738]: https://codeberg.org/dnkl/foot/issues/1738

8
csi.c
View file

@ -129,7 +129,13 @@ csi_sgr(struct terminal *term)
case 8: term->vt.attrs.conceal = true; break;
case 9: term->vt.attrs.strikethrough = true; break;
case 21: break; /* double-underline, not implemented */
case 21:
term->vt.attrs.underline = true;
term->vt.underline.style = UNDERLINE_DOUBLE;
term->bits_affecting_ascii_printer.underline_style = true;
term_update_ascii_printer(term);
break;
case 22: term->vt.attrs.bold = term->vt.attrs.dim = false; break;
case 23: term->vt.attrs.italic = false; break;
case 24: {

View file

@ -159,6 +159,8 @@ m*.
: Conceal; text is not visible, but is copiable
| 9
: Crossed-out/strike
| 21
: Double underline
| 22
: Disable *bold* and *dim*
| 23