Emacs – M-x shell color

By Rares Vernica

> Any idea how to set the color of the shell prompt in emacs?
>
> Not sure how much of this has to do with my windowing system (Windows
> XP) and shell (putty) or version of emacs and host.

I don’t think you’ll get ANSI color in your Emacs terminal unless you have this:

;; Add color to a shell running in emacs ‘M-x shell’
(autoload ‘ansi-color-for-comint-mode-on “ansi-color” nil t)
(add-hook ’shell-mode-hook ‘ansi-color-for-comint-mode-on)

Then set the colors:

(custom-set-faces
;; custom-set-faces was added by Custom — don’t edit or cut/paste it!
;; Your init file should contain only one such instance.
‘(comint-highlight-prompt ((t (:foreground “white”)))))

One Response to “Emacs – M-x shell color”

  1. Emacs: cor no “M-x shell” « blogvs gvstavinianvs Says:

    [...] Fica perfeito. Dica tirada daqui. [...]

Leave a Reply

You must be logged in to post a comment.