I use Ubuntu8.10 and emacs-snapshot. Running shell-mode on emacs and input "ls" shows escape codes:
How can I get the output I expect?
I use Ubuntu8.10 and emacs-snapshot. Running shell-mode on emacs and input "ls" shows escape codes:
How can I get the output I expect?
The problem is that "l" is trying to colorise the output and emacs isn't having any of it. Try the following:
$ unalias l $ alias l ls --color=never
Furthermore, you may choose another shell: M-x term
or M-x eshell
. The former provides an interface that is much closer to a real terminal emulator than shell-mode
(once you start it, you can get out of the mode with C-c C-j
and get in again with C-c C-k
). The latter is a shell implementation written in Elisp (you can use the common shell commands as well as evaluating Lisp code).
Expanding on vatine's answer, you can add that inside your .cshrc (.tcshrc/.bashrc) wrapped with a check for the environment variable INSIDE_EMACS.
For example (from my .tcshrc):
if ( $?INSIDE_EMACS ) then
alias l 'ls --color=never'
endif