underlines.rst 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Colored and styled underlines
  2. ================================
  3. |kitty| supports colored and styled (wavy) underlines. This is of particular use
  4. in terminal based text editors such as :program:`vim` and :program:`emacs` to
  5. display red, wavy underlines under mis-spelled words and/or syntax errors. This
  6. is done by re-purposing some SGR escape codes that are not used in modern
  7. terminals (`CSI codes <https://en.wikipedia.org/wiki/ANSI_escape_code#CSI_(Control_Sequence_Introducer)_sequences>`__)
  8. To set the underline style::
  9. <ESC>[4:0m # no underline
  10. <ESC>[4:1m # straight underline
  11. <ESC>[4:2m # double underline
  12. <ESC>[4:3m # curly underline
  13. <ESC>[4:4m # dotted underline
  14. <ESC>[4:5m # dashed underline
  15. <ESC>[4m # straight underline (for backwards compat)
  16. <ESC>[24m # no underline (for backwards compat)
  17. To set the underline color (this is reserved and as far as I can tell not
  18. actually used for anything)::
  19. <ESC>[58...m
  20. This works exactly like the codes ``38, 48`` that are used to set foreground and
  21. background color respectively.
  22. To reset the underline color (also previously reserved and unused)::
  23. <ESC>[59m
  24. The underline color must remain the same under reverse video, if it has a color,
  25. if not, it should follow the foreground color.
  26. To detect support for this feature in a terminal emulator, query the terminfo
  27. database for the ``Su`` boolean capability.