Add support for Kitty/VTE extended underlines (4:x) [SGR] #10076

Open
opened 2026-01-31 02:11:54 +00:00 by claunia · 0 comments
Owner

Originally created by @DHowett on GitHub (Aug 9, 2020).

depends on #4321

Re underline:

The Kitty terminal emulator came up with the awesome idea of supporting curly and colored underlines, with the obvious intent of supporting user-friendly spell checking in terminal-based text editors. The choice of the escape sequence was coordinated between Kitty and VTE. The feature was then implemented so far at least in Kitty, VTE, Mintty, Hterm, probably a few more as well, and feature requests are filed to even more, including iTerm2, Konsole, xterm.js. Some have even added dotted and dashed underlines, too.

It would be lovely if you also considered these extensions.

(A bit of technical info: With truecolor support I assume you already have like 25 bits for the foreground and background color each (in order to be able to store the 256 legacy palette values as well as "default", in addition to 24 bit RGB). At least this is how we do in VTE. And we didn't want to waste another 25 bits for this rarely used feature. So we approximate truecolor underline colors to 4+5+4 bits of R, G, B, respectively. This way all the color information of a charcell fits in an int64.)
from egmontkob in #2916

For what it's worth I've extended this a little, and my programs support the following subparameters:

  1. single
  2. double
  3. (short wavelength) curly
  4. (closely spaced) dotted (8 dots per cell)
  5. (short) dashed (4 eighth-width dashes per cell)
  6. long dashed (2 quarter-width dashes per cell)
  7. extra long dashed (1 half-width dash per cell)
  8. medium spaced dotted (4 dots per cell)
  9. widely spaced dotted (2 dots per cell)
  10. long wavelength curly

from @jdebp in #2916

Originally created by @DHowett on GitHub (Aug 9, 2020). _depends on #4321_ > > > Re underline: > > The Kitty terminal emulator came up with the awesome idea of supporting [curly and colored underlines](https://sw.kovidgoyal.net/kitty/protocol-extensions.html#colored-and-styled-underlines), with the obvious intent of supporting user-friendly spell checking in terminal-based text editors. The choice of the escape sequence was coordinated between Kitty and VTE. The feature was then implemented so far at least in [Kitty](https://github.com/kovidgoyal/kitty/issues/226), [VTE](https://bugzilla.gnome.org/show_bug.cgi?id=721761), [Mintty](https://github.com/mintty/mintty/commit/7f12598a2cc2ded4fdb695fede237efe45785273), [Hterm](https://groups.google.com/a/chromium.org/forum/#!topic/chromium-hterm/ncWSu-hV7r8), probably a few more as well, and feature requests are filed to even more, including [iTerm2](https://gitlab.com/gnachman/iterm2/issues/6382), [Konsole](https://bugs.kde.org/show_bug.cgi?id=387811), [xterm.js](https://github.com/xtermjs/xterm.js/issues/1145). Some have even added dotted and dashed underlines, too. > > It would be lovely if you also considered these extensions. > > (A bit of technical info: With truecolor support I assume you already have like 25 bits for the foreground and background color each (in order to be able to store the 256 legacy palette values as well as "default", in addition to 24 bit RGB). At least this is how we do in VTE. And we didn't want to waste another 25 bits for this rarely used feature. So we approximate truecolor underline colors to 4+5+4 bits of R, G, B, respectively. This way all the color information of a charcell fits in an int64.) > _from egmontkob in #2916_ > > > For what it's worth I've extended this a little, and my programs support the following subparameters: > > 1. single > 2. double > 3. (short wavelength) curly > 4. (closely spaced) dotted (8 dots per cell) > 5. (short) dashed (4 eighth-width dashes per cell) > 6. long dashed (2 quarter-width dashes per cell) > 7. extra long dashed (1 half-width dash per cell) > 8. medium spaced dotted (4 dots per cell) > 9. widely spaced dotted (2 dots per cell) > 10. long wavelength curly > > _from @jdebp in #2916_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10076