Feb
7
2007
0
Emacs: Enabling Colors in Shell Mode
Posted by Rex under Development | Permalink | | Leave A Comment
I customize my Bash shell with colorful prompts. But while, in a normal xterm, my prompt is displayed nicely, it looks like crap within Emacs. All the escaped color attributes get displayed as garbage characters. I finally got off my lazy butt and spent sometime looking into fixing it.
It turns out to be pretty straightforward, basically the way I fix it is to turn on ANSI colors in the shell. I add the following to my .emacs
file to turn it on as part of a hook to the shell mode.
; enable ANSI color in shell mode
(add-hook ‘shell-mode-hook ‘ansi-color-for-comint-mode-on)