Some Unix command line tools display text in colour, if you run them in the right kind of terminal, of which the Emacs shell isn’t one. So far this had not really bothered me since in most cases the colours do not convey all that much information. However, recently I was playing with Maude, which colours terms for debugging purposes. There is no easy alternative for getting hold of the same information.
A few minutes of googling and experimenting produced the magic Emacs command
followed by customisation of the
ansi-color-for-comint-mode variable (setting it to
t) or calling
(ansi-color-for-comint-mode-on). This applies across all comint sessions, not just shell sessions, so it also affects things like the interactive Maude mode.
Under Emacs one can go further with
M-x ansi-term, which creates a fully-fledged ansi terminal inside an emacs buffer. Finally we can run Emacs inside Emacs inside Emacs …! Ansi-term is not available for XEmacs, probably because it is some ghastly hack.