Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs/xterm color annoyance on Linux

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.

like image 371
Todd Gamblin Avatar asked Mar 24 '09 22:03

Todd Gamblin


People also ask

How do I change colors in Emacs?

To change the foreground or background color in Emacs through the windowing interface, you can use the menu commands Foreground Color->Other and Background Color->Other in the Edit->Text Properties menu.


2 Answers

The color brightwhite looks ok on my Emacs (which is running under a terminal, not X). On RHEL5 I have my TERM environment variable set to xterm-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 do M-x list-colors-display. If not, you are probably missing the right termcap entry (try installing the libtermcap-devel package, I think).

If I change TERM to xterm-color, then brightwhite comes out a bit gray in the output of list-colors-display.

I'm not sure about RHEL4.

like image 78
Jacob Gabrielson Avatar answered Sep 22 '22 03:09

Jacob Gabrielson


What about:

(set-foreground-color "brightwhite")

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.

like image 40
Sean Bright Avatar answered Sep 23 '22 03:09

Sean Bright