Reputation: 819
I have a wierd error, I can't seem to get pretty ls colours when using the emacs basic shell. While googling I tried sourcing my bashrc which defines the color vector (which works for my other external shells), I've tried adding
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
to my .emacs, neither of which helped.
I then spotted some wierd behaviour. When I start a shell, exit the process and then start another shell in the same buffer, the hostname colour from the previsous session changes.
I have no idea what to try from here! Any ideas?
I'm running GNU Emacs for OSX version 24.3.50.1
Upvotes: 1
Views: 1271
Reputation: 185
With help from this question, I was able to get it working by simply explicitly exporting TERM=xterm-256color
in ~/.emacs.d/init_bash.sh
. Haven't played around with it much yet, but it seems to do the thing now. Maybe it'll work for you.
Upvotes: 1
Reputation: 3178
Try running ls --color=always
; ls may not recognize that colors are available, and this will tell it to use them anyway. If that works, then an easy way to use that all the time is to define an alias: alias ls='ls --color=always
(note that aliases are a Bash feature, not an Emacs feature). It's likely that you already have an alias or two defined in your Bash profile, so it may just be a matter of editing that one to make the change permanent.
Upvotes: 0