xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/vga-softcursor.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSoftware cursor for VGA
2*4882a593Smuzhiyun=======================
3*4882a593Smuzhiyun
4*4882a593Smuzhiyunby Pavel Machek <pavel@atrey.karlin.mff.cuni.cz>
5*4882a593Smuzhiyunand Martin Mares <mj@atrey.karlin.mff.cuni.cz>
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunLinux now has some ability to manipulate cursor appearance.  Normally,
8*4882a593Smuzhiyunyou can set the size of hardware cursor.  You can now play a few new
9*4882a593Smuzhiyuntricks: you can make your cursor look like a non-blinking red block,
10*4882a593Smuzhiyunmake it inverse background of the character it's over or to highlight
11*4882a593Smuzhiyunthat character and still choose whether the original hardware cursor
12*4882a593Smuzhiyunshould remain visible or not.  There may be other things I have never
13*4882a593Smuzhiyunthought of.
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunThe cursor appearance is controlled by a ``<ESC>[?1;2;3c`` escape sequence
16*4882a593Smuzhiyunwhere 1, 2 and 3 are parameters described below. If you omit any of them,
17*4882a593Smuzhiyunthey will default to zeroes.
18*4882a593Smuzhiyun
19*4882a593Smuzhiyunfirst Parameter
20*4882a593Smuzhiyun	specifies cursor size::
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun		0=default
23*4882a593Smuzhiyun		1=invisible
24*4882a593Smuzhiyun		2=underline,
25*4882a593Smuzhiyun		...
26*4882a593Smuzhiyun		8=full block
27*4882a593Smuzhiyun		+ 16 if you want the software cursor to be applied
28*4882a593Smuzhiyun		+ 32 if you want to always change the background color
29*4882a593Smuzhiyun		+ 64 if you dislike having the background the same as the
30*4882a593Smuzhiyun		     foreground.
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun	Highlights are ignored for the last two flags.
33*4882a593Smuzhiyun
34*4882a593Smuzhiyunsecond parameter
35*4882a593Smuzhiyun	selects character attribute bits you want to change
36*4882a593Smuzhiyun	(by simply XORing them with the value of this parameter). On standard
37*4882a593Smuzhiyun	VGA, the high four bits specify background and the low four the
38*4882a593Smuzhiyun	foreground. In both groups, low three bits set color (as in normal
39*4882a593Smuzhiyun	color codes used by the console) and the most significant one turns
40*4882a593Smuzhiyun	on highlight (or sometimes blinking -- it depends on the configuration
41*4882a593Smuzhiyun	of your VGA).
42*4882a593Smuzhiyun
43*4882a593Smuzhiyunthird parameter
44*4882a593Smuzhiyun	consists of character attribute bits you want to set.
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun	Bit setting takes place before bit toggling, so you can simply clear a
47*4882a593Smuzhiyun	bit by including it in both the set mask and the toggle mask.
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunExamples
50*4882a593Smuzhiyun--------
51*4882a593Smuzhiyun
52*4882a593SmuzhiyunTo get normal blinking underline, use::
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun	echo -e '\033[?2c'
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunTo get blinking block, use::
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun	echo -e '\033[?6c'
59*4882a593Smuzhiyun
60*4882a593SmuzhiyunTo get red non-blinking block, use::
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun	echo -e '\033[?17;0;64c'
63