Change emacs bash colors for ls command

I turned on dircolors to change the ls command to yellow for folders when using ls. The problem is that when I use the shell in emacs, it still shows them as dark blue, which is hard to read against a black background.

How to change colors for the bash shell or, more specifically, the ls command. My color changes to an open terminal, but not to emacs. I have emacs23 with X support.

+6
bash colors emacs
source share
2 answers

If you use ansi-color, it accepts colors from the ansi-color-names vector, by default:

["black" "red" "green" "yellow" "blue" "magenta" "cyan" "white"] 

You can adjust the output colors of the shell by changing the variable ansi-color-names-vector.

Here is mine, work well with the zenburn theme.

 (setq ansi-color-names-vector ["black" "tomato" "PaleGreen2" "gold1" "DeepSkyBlue1" "MediumOrchid1" "cyan" "white"]) 

To see the changes, evaluate the following expression and the next one will consider

 (setq ansi-color-map (ansi-color-make-color-map)) 

Hope this helps.

+10
source share

Assuming you are using Mx shell & hellip;

Ch f shell RET says:

If the file ~/.emacs_SHELLNAME' exists, or ~ / .emacs.d / init_SHELLNAME.sh', it is entered as the original input (but this may be lost due to a time error if the shell discards input at startup).

So, if you export the LS_COLORS environment LS_COLORS to ~/.emacs.d/init_bash.sh , Emacs should use it.

Edit: hmmm ... I'm not sure shell supports this. (I have problems with Vista + Cygwin, anyway!)

You might also like to try Mx term or Mx ansi-term ?

0
source share

All Articles