How do I make the virtual consoles behave like monochrome terminals?
By "virtual consoles" I mean the terminals accessible with [Ctrl]+[Alt]+[F1-F6]. I just installed Slackware 13.37 with kernel 2.6.37.6-smp. By default the console behaves like a color terminal. The normal text is grey, and many programs (ls, man, emacs, vi, etc.) use other colors as well. But I would really like it to behave like a monochrome terminal: displaying text as normal, underlined, highlighted, or bold, with no colors other than the normal and bold colors. Preferably in amber or green. I'm not using X windows and I plan on spending most of my time within these virtual consoles, so I'm willing to put some work into getting them looking right.
Code:
setterm -foreground yellow -background black -store If I use setterm to make the text green it looks good enough. But still, using either of these commands does not permanently change the color. It only changes the color of the console from which it was executed. And even then, programs still act like it's a color terminal and print colors. When I reboot the console forgets its previous color settings and is back to the default grey. I want all the consoles to be monochrome all the time, even while booting, if possible. This website said the problem could be solved by modifying the kernel source in the file "/usr/src/linux/drivers/char/console.c" Unfortunately, I cannot find the file to which they are referring. I was able to stop ls from displaying in color by disabling the dircolors script and adding some aliases to /etc/profile. But I still don't how to make all the other programs run in monochrome mode. Thank you for your time and consideration. Any advice is greatly appreciated! Regards, trough |
IIRC, these console shells are considered login shells, so they don't read bashrc by default. They do read /etc/profile and bash_profile however (see the INVOCATION section of the bash man page).
So you can use one of these files to add your startup commands, or to import your bashrc or another file from it. Code:
#import contents of /etc/bashrc if it exists Code:
if [[ "$TERM" =~ xterm ]]; then |
Thank you. That does make ~/.bashrc work. Now when I login, the colors are changed. But is there any way this could be done when the computer boots?
How can I prevent the console from displaying other colors? Can I redefine all the other colors somehow? |
I really don't know all that much personally about how terminals/consoles are customized. It's still all a confusing morass of crypto-jargon to me :).
But I just ran across this: Bashish. Perhaps it can help you do what you want? |
As David the H. has pointed out, the key script is /etc/profile.
When Slackware boots, /etc/inittab is consulted for the standard console login getties. The agetty entries default to running /bin/login which in turn runs /bin/bash by default as specified in /etc/passwd. In /etc/profile there is: Code:
# Set TERM to linux for unknown type or unset variable: By doing this I can then have a mono terminal that obeys the 'setterm -foreground yellow' style of command. To complicate matters, also in /etc/profile there is: Code:
# Append any additional sh scripts found in /etc/profile.d/: This is needed to stop programs such as ls causing problems for your mono look. You will probably have to look at decolourising other outputs to make this stick. 'man' as it stands will upset things. |
Thank you, this has been very useful information. I was also able to get vi and man to run in monochrome, unfortunately I can't get emacs do to it though. But this is good enough for me. Thanks for the help!
|
All times are GMT -5. The time now is 05:25 PM. |