I have shell-mode
set up to work with ANSI colors. In older versions of Emacs, this extended to the prompt but now it doesn't and the prompt remains uncolored.
PS1
is set with ANSI color codes which work when it's printed out but don't work in the actual prompt itself:
I tried following the advice from an old StackOverflow answer and setting the comint-highlight-prompt
face to not inherit:
(set-face-attribute 'comint-highlight-prompt nil
:inherit nil)
This made the prompt the same color as normal text, still ignoring ANSI codes:
It seems like versions of comint.el had a custom-set variable comint-highlight-prompt
which could be set to nil
, but the variable doesn't seem to exist on my version of Emacs. (Actually, I'm not sure exactly where that file came from, but I found it on a Google search :).)