vga-softcursor.rst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Software cursor for VGA
  2. =======================
  3. by Pavel Machek <pavel@atrey.karlin.mff.cuni.cz>
  4. and Martin Mares <mj@atrey.karlin.mff.cuni.cz>
  5. Linux now has some ability to manipulate cursor appearance. Normally,
  6. you can set the size of hardware cursor. You can now play a few new
  7. tricks: you can make your cursor look like a non-blinking red block,
  8. make it inverse background of the character it's over or to highlight
  9. that character and still choose whether the original hardware cursor
  10. should remain visible or not. There may be other things I have never
  11. thought of.
  12. The cursor appearance is controlled by a ``<ESC>[?1;2;3c`` escape sequence
  13. where 1, 2 and 3 are parameters described below. If you omit any of them,
  14. they will default to zeroes.
  15. first Parameter
  16. specifies cursor size::
  17. 0=default
  18. 1=invisible
  19. 2=underline,
  20. ...
  21. 8=full block
  22. + 16 if you want the software cursor to be applied
  23. + 32 if you want to always change the background color
  24. + 64 if you dislike having the background the same as the
  25. foreground.
  26. Highlights are ignored for the last two flags.
  27. second parameter
  28. selects character attribute bits you want to change
  29. (by simply XORing them with the value of this parameter). On standard
  30. VGA, the high four bits specify background and the low four the
  31. foreground. In both groups, low three bits set color (as in normal
  32. color codes used by the console) and the most significant one turns
  33. on highlight (or sometimes blinking -- it depends on the configuration
  34. of your VGA).
  35. third parameter
  36. consists of character attribute bits you want to set.
  37. Bit setting takes place before bit toggling, so you can simply clear a
  38. bit by including it in both the set mask and the toggle mask.
  39. Examples
  40. --------
  41. To get normal blinking underline, use::
  42. echo -e '\033[?2c'
  43. To get blinking block, use::
  44. echo -e '\033[?6c'
  45. To get red non-blinking block, use::
  46. echo -e '\033[?17;0;64c'