I'm using emacs in a console window both on my local Linux box and on the login node of a remote cluster. I use emacs regularly, and I've got the foreground color set to white in my .emacs file like so:
(set-foreground-color "white")
(set-background-color "black")
However, when I run emacs, the foreground isn't white; it's grey and very hard to read. On my Mac, emacs in a console window with the same settings shows up as proper white. But on both linux boxes, in konsole and xterm, it's grey.
In case it matters, I've got TERM
set to xterm-color, the desktop is running RHEL 5, and the cluster node is running RHEL 4 (CentOS).
Is this some default with how Linux sets up terminal colors? How do I get white to be white?
Note: this is with console emacs, not emacs under X. That's emacs -nw
if you have DISPLAY
set.
Looks like you're only setting the foreground color.
I'm sure you meant
set-background-color
on the latter.I can confirm this when running Emacs as:
too.
What if you just used reverse-video for the console version is that good enough?
I did some experiments, and you can set console colors in emacs, but you are limited to this palette:
The white that you get is somewhat grayed out; full bright white is reserved for bold text. So if you run
you will get bold (bright white) text for later insertions.
I had no luck trying to force the default face to bold. (I don't really understand how faces work in emacs.)
The color
brightwhite
looks ok on my Emacs (which is running under a terminal, not X). On RHEL5 I have myTERM
environment variable set toxterm-256color
. If it's working correctly, you should be able to run these scripts and see 256-color output. Under Emacs, you should see a reasonably smooth color ramp (no obviously duplicated colors) when you doM-x list-colors-display
. If not, you are probably missing the right termcap entry (try installing thelibtermcap-devel
package, I think).If I change
TERM
toxterm-color
, thenbrightwhite
comes out a bit gray in the output oflist-colors-display
.I'm not sure about RHEL4.
What about:
In response to comment:
Within emacs, run
M-x list-colors-display
which should show you all of the colors that emacs thinks are available with your terminal.I also found that I had weird colors in terminal mode and finally traced it down to a font face customization. I had something like this:
I removed the foreground and background properties and everything started looking hunky-dory.