Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adjusting shell mode color schemes

The color schemes in emacs shell mode appear as primary colors (high saturation) and look primitive, and some colors, for example, purple, do not appear:

enter image description here

I want to adjust the colors so that they use more intermediate colors and look more soft as in gnome-terminal:

enter image description here

How can I change the color schemes in shell mode? I couldn't find shell-mode related font assignments in emacs, and that is probably because the color is given by the shell and is different from other font assignmets in emacs.

like image 569
sawa Avatar asked Jul 01 '11 14:07

sawa


1 Answers

When a program run inside shell-mode issues ANSI escape characters to set the display color to, say, magenta, Emacs intercepts those escape characters and creates a colored overlay using that exact foreground color "magenta". So there's no color theme interaction going on here, and no shell-specific customizations to look for.

The interception is made by the functions in ansi-color.el, though, and it looks like you could customize ansi-color-names-vector, so to use "PaleBlue" for "blue", either M-x customize RET ansi-color-names-vector, or try putting something like the following in your emacs config:

(setq ansi-color-names-vector
  ["black" "red" "green" "yellow" "PaleBlue" "magenta" "cyan" "white"])

To see available color names, use M-x list-colors-display, or enter hex colors instead, e.g. "#ccccff".

like image 124
sanityinc Avatar answered Sep 19 '22 15:09

sanityinc