A linux kernel should store an on-screen log for your vts in the corresponding /dev/vcsa*[ttynum]
device.
It is why the following works:
echo hey >/dev/tty2
dd bs=10 count=1 </dev/vcs2
...which prints...
hey
The corresponding /dev/vcsa[ttynum]
device will store an encoded version of the formatted text on-screen, whereas the /dev/vcs[ttynum]
will be a plain dump. The vcsa[ttynum]
devices will encode a pair of bytes which describe each on-screen char and its attributes, as well as a string at the head of each logical page that indicates the referenced tty's lines,columns count.
As @kasperd points out, I had it wrong before by assuming the \a
BEL was encoded between every character, when in fact: The default color combination happens to coincide with the bell character.
For your purposes using the /dev/vcs[ttynum]
is probably easiest. Here's a l
ook at the differences:
echo hey >/dev/tty2
dd bs=10 count=1 </dev/vcs2 |
sed -n l
...prints...
hey $
...and...
echo hey >/dev/tty2
dd bs=10 count=1 </dev/vcsa2 |
sed -n l
...prints...
0\200\000\004h\ae\ay\a$
The 8 standard colors numbered 1 through 8 officially contains primary and secondary colors (black, red, green, yellow, blue, magenta, cyan, white), but there is considerable variation: many terminals don't show primary colors, but instead show variants thereof. Yours shows the following RGB values:
383a3a ff3950 00b226 c56227 022bab fd16de 00b5ae aeb2b3
while nominal values with roughly similar brightness would be
000000 a00000 00a000 808000 0000a0 800080 008080 808080
There is considerable variation on all colors, not just on the one for which you choose to give a different name. Yellow does however have a tradition of being made more brownish because actual yellow tends to be poorly contrasted on a white background (and sometimes blue is made more grayish to be better-contrasted on a black background).
You can change the colors used by Konsole if they bother you. In the profile settings, go to the “Appearance” tab and either choose from one of the profiles or make up your own. You can even make the colors resemble nothing like the standard ones if you wish, though that may be confusing at times.
Best Answer
I'm sure you could make a command with
dbus
. But there is a shortcut for clear scrollback and reset by default. Ctrl + shift + x.