In shell buffers inside Emacs (M-x shell), many programs want to use color in useful ways. For example,
grep can highlight the portion of the line that matches the search pattern. Here's what I use to make Emacs and XEmacs show colors in shell windows:
;;; Shell mode (setq ansi-color-names-vector ; better contrast colors ["black" "red4" "green4" "yellow4" "blue3" "magenta4" "cyan4" "white"]) (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
I also use these settings to turn off word wrap and to make the prompt read-only:
(add-hook 'shell-mode-hook '(lambda () (toggle-truncate-lines 1))) (setq comint-prompt-read-only t)
Shell mode is handy but I find that I often just switch to a terminal window, mainly because I can pipe commands through
less. If the output is very short, either Emacs or a terminal is fine. If it's of medium length, Emacs is usually nicer, since it lets me search and cut and paste easily. If the command has very long output, the terminal is nicer, because
less lets me see just parts of the output. I haven't found a way in Emacs to deal with processes that output lots of lines.