Tiny Core Base > TCB Tips & Tricks
Invert console screen fun
(1/1)
PDP-8:
Inverting the screen colors is useful to me when I'm not actually writing code, but magnificient prose for other humans to read.
Pretty easy from the console:
Invert the screen
--- Code: ---echo -e '\033[?5h'
--- End code ---
Back to normal:
--- Code: ---echo -e '\033[?5l'
--- End code ---
Works fine in the console, or even in Aterm. Since I run multivt, or have many Aterm windows open at a time, inverting the screen makes it easy to identify one that I shouldn't mess with, like stopping a compile.
But notice how similar it looks to the command for console-blanking. Let's put the two together and see where my fast fingers betrayed me when I couldn't figure out why my console wasn't blanking:
--- Code: ---echo -e '\033[?5h'
echo -e '\033[9;10]'
--- End code ---
The first one inverts the screen. The second one sets console blanking to 10 minutes.
What burned me is when fooling around with console blanking, I would forget to add the right bracket. So here's what happened when I lost attention to the right bracket:
1) If I used a right bracket ] with the screen invert, it would still invert, but just echo'ed out the spurious right bracket to the screen.
--- Code: ---echo -e '\033[?5h]'
--- End code ---
Inverts, but spews that right bracket to screen
2) If I *forgot* to use the right bracket with the console-blanking, the system would happily accept it, but no blanking would occur.
--- Code: ---echo -e '\033[9;10'
--- End code ---
Bzzzt! no blanking.
Just a warning - I was tearing my hair out playing with shell scripts, and that missing right bracket got me with no console blanking.
Navigation
[0] Message Index
Go to full version