162306a36Sopenharmony_ciSoftware cursor for VGA
262306a36Sopenharmony_ci=======================
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciby Pavel Machek <pavel@atrey.karlin.mff.cuni.cz>
562306a36Sopenharmony_ciand Martin Mares <mj@atrey.karlin.mff.cuni.cz>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciLinux now has some ability to manipulate cursor appearance.  Normally,
862306a36Sopenharmony_ciyou can set the size of hardware cursor.  You can now play a few new
962306a36Sopenharmony_citricks: you can make your cursor look like a non-blinking red block,
1062306a36Sopenharmony_cimake it inverse background of the character it's over or to highlight
1162306a36Sopenharmony_cithat character and still choose whether the original hardware cursor
1262306a36Sopenharmony_cishould remain visible or not.  There may be other things I have never
1362306a36Sopenharmony_cithought of.
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciThe cursor appearance is controlled by a ``<ESC>[?1;2;3c`` escape sequence
1662306a36Sopenharmony_ciwhere 1, 2 and 3 are parameters described below. If you omit any of them,
1762306a36Sopenharmony_cithey will default to zeroes.
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_cifirst Parameter
2062306a36Sopenharmony_ci	specifies cursor size::
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci		0=default
2362306a36Sopenharmony_ci		1=invisible
2462306a36Sopenharmony_ci		2=underline,
2562306a36Sopenharmony_ci		...
2662306a36Sopenharmony_ci		8=full block
2762306a36Sopenharmony_ci		+ 16 if you want the software cursor to be applied
2862306a36Sopenharmony_ci		+ 32 if you want to always change the background color
2962306a36Sopenharmony_ci		+ 64 if you dislike having the background the same as the
3062306a36Sopenharmony_ci		     foreground.
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci	Highlights are ignored for the last two flags.
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cisecond parameter
3562306a36Sopenharmony_ci	selects character attribute bits you want to change
3662306a36Sopenharmony_ci	(by simply XORing them with the value of this parameter). On standard
3762306a36Sopenharmony_ci	VGA, the high four bits specify background and the low four the
3862306a36Sopenharmony_ci	foreground. In both groups, low three bits set color (as in normal
3962306a36Sopenharmony_ci	color codes used by the console) and the most significant one turns
4062306a36Sopenharmony_ci	on highlight (or sometimes blinking -- it depends on the configuration
4162306a36Sopenharmony_ci	of your VGA).
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_cithird parameter
4462306a36Sopenharmony_ci	consists of character attribute bits you want to set.
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci	Bit setting takes place before bit toggling, so you can simply clear a
4762306a36Sopenharmony_ci	bit by including it in both the set mask and the toggle mask.
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ciExamples
5062306a36Sopenharmony_ci--------
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ciTo get normal blinking underline, use::
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci	echo -e '\033[?2c'
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ciTo get blinking block, use::
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci	echo -e '\033[?6c'
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_ciTo get red non-blinking block, use::
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci	echo -e '\033[?17;0;64c'
63