deccara.rst 1018 B

123456789101112131415161718192021
  1. Setting text styles/colors in arbitrary regions of the screen
  2. ------------------------------------------------------------------
  3. There already exists an escape code to set *some* text attributes in arbitrary
  4. regions of the screen, `DECCARA
  5. <https://vt100.net/docs/vt510-rm/DECCARA.html>`__. However, it is limited to
  6. only a few attributes. |kitty| extends this to work with *all* SGR attributes.
  7. So, for example, this can be used to set the background color in an arbitrary
  8. region of the screen.
  9. The motivation for this extension is the various problems with the existing
  10. solution for erasing to background color, namely the *background color erase
  11. (bce)* capability. See :iss:`this discussion <160#issuecomment-346470545>`
  12. and `this FAQ <https://invisible-island.net/ncurses/ncurses.faq.html#bce_mismatches>`__
  13. for a summary of problems with *bce*.
  14. For example, to set the background color to blue in a rectangular region of the
  15. screen from (3, 4) to (10, 11), you use::
  16. <ESC>[2*x<ESC>[4;3;11;10;44$r<ESC>[*x