13

When I load a custom color scheme (through M-x load-theme or M-x customize-theme) the results only seem to be applied when Emacs runs in a separate window:

Emacs in GUI

But when Emacs is run in a terminal with -nw, the default colors seem to be used:

Emacs in terminal
(source: raghav at www.ocf.berkeley.edu)

I'm new to Emacs, so I don't know if this is expected behavior -- but it doesn't seem to be, since Googling turns up several people discussing using color themes in console mode. Any help would be much appreciated.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Raghav
  • 163
  • 1
  • 1
  • 6
  • 3
    What is the value in TERM for your environment? I had this problem and did "export TERM=xterm-256color" in my .bash_profile to fix it. I see the link below in bzg's answer also makes reference to this. Have you tried that yet? – jmq Apr 30 '12 at 03:16
  • Thanks, this is interesting -- doing so does result in changes when different themes are selected. Unfortunately, this results in the colors being [way off](http://www.ocf.berkeley.edu/~raghav/images/256colors.png). I suspect this may be because the theme uses colors that aren't in the standard 256 color palette; it's intended to be used by people who've redefined the 16 standard colors to the ones appropriate to the color theme (as I have). – Raghav May 01 '12 at 00:08

3 Answers3

9

I am very late, but I had the same problem and I solved it adding the following line to my ~/.zshrc

export TERM=xterm-256color

If you are not using zsh (for example you are using bash), you must add it on your right console init file (for example ~/.bashrc)

4

See this question: How to make Emacs terminal colors the same as Emacs GUI colors?

The theme in your console looks quite close to the one in the GUI, so my bet is that you will have to live with it -- or use the GUI.

Community
  • 1
  • 1
bzg
  • 2,515
  • 17
  • 19
  • I don't think the problem has to do with limitations in my terminal's color palette -- for one thing, none of the Emacs 24 color themes has any effect in the terminal, and for another, the old color-theme package did work. – Raghav Apr 30 '12 at 01:42
-1

Using the following in ~/.Xresources seems to get rid of the blue background that comes after exporting TERM=xterm-256color:

emacs*Background: #002b36
emacs*Foreground: #839496
matthias krull
  • 4,389
  • 3
  • 34
  • 54