Emacs Shell Ansi Colors 2

Posted by ch0wda on December 13 2007 at 03:58 PM

In a previous post I mentioned a funky character encoding issue with my Emacs Autotest output. I finally looked into the cause and came across the solution. I just needed to enable ansi-colors in my Emacs shell.

In your .emacs file, add the following:

   ;; 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)

Cheap and easy. Now, you’ll get all the cool ansi colors, like the kids.

Comments

Leave a response

  1. Matt
    MattDecember 14, 2007 @ 02:45 PM

    Not really related to this post, but when will the beta version of your new book be available? Can’t wait to read it.

  2. Josh
    JoshDecember 24, 2007 @ 11:37 AM

    Matt,

    At this time, Apress does not really have a “beta” books program. I certainly wish that they did, look for the book to be published sometime in late spring of 2008. Also, keep checking back here for some content on Scaling Rails. I’m going to try to introduce some of the concepts in the book here.