Short answer
echo -n -e '\e[?0c' #DISAPPEAR echo -n -e '\e[?16;0;64c' #REAPPEAR echo -n -e '\e[?16;0;80c' #REAPPEAR w/highlighting
Long answer
To date, the current version of the tty age (found in util-linux 2.27.1
[util-linux is the linux package that provides most of the basic commands, for example login
, su
, mount
, more
, kill
- to name a few] - and you should have it if your version of the Linux kernel> = 4.4) has a different behavior than described in the kernel.org documentation not yet updated ( Program cursor for VGA ).
Consider
echo -n -e '\e[?
Byte 1 ;
byte2 ;
byte 3 c'
Byte 1:
+---------------+---------------+ | high nibble | low nibble | +---+-----------+-----------+---+ |msb| | |lsb| +---+---+---+---+---+---+---+---+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +---+---+---+---+---+---+---+---+ | | | | | | | +-+ | | | | These bits specify the 8 | | +-----+-> possible blinking HW carets | | | | +---------+ | +---------------> When set, this bit enables SW caret instead of HW caret
byte2 (SW caret):
+-----------------> A pretty useless mask applied | to bits in byte3 +---------------+---------------+ | high nibble | low nibble | +---+-----------+-----------+---+ |msb| | |lsb| +---+---+---+---+---+---+---+---+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +---+---+---+---+---+---+---+---+
byte3 (SW caret):
+---------------+---------------+ | high nibble | low nibble | +---+-----------+-----------+---+ |msb| | |lsb| +---+---+---+---+---+---+---+---+ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | +---+---+---+---+---+---+---+---+ | | | | | | | +-------------------> Highlighting | | | | | +---------------------+ | | | | +-------------------------+-> Color | | +-----------------------------+
Backlight: emphasizes the character under the carriage (for example, changing it to white [true shiny white] instead of dark white [light gray, commonly used for TTY]).
Color: carriage color. Please note that in comparison with the usual order of ANSI color codes, which we all know and love, the bits are reversed, so for this triplet - the 7th - L sb, and the 5th - M sb.
So, although in the 70s ANSI defined the following color codes, setting the de facto standard universally accepted for TTY, various Linux terminals, consoles and something else
000 (0) black 001 (1) red 010 (2) green 011 (3) yellow or dark yellow 100 (4) blue or dark blue 101 (5) magenta, purple or violet 110 (6) cyan or light blue 111 (7) white or dark white (light gray)
in this case we have the opposite
000 (0) black 100 (4) red 010 (2) green 110 (6) yellow or dark yellow 001 (1) blue or dark blue 101 (5) magenta, purple or violet 011 (3) cyan or light blue 111 (7) white or dark white (light gray)
(Octal value in parentheses)
So here is the list: