Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

While emacs shell mode when I run


I get following

   [0m[01;[0m     [01;34mtemplates[0m

these must be and templates. Why its like that and how can fix it?

share|improve this question

Those are vt100 codes for color display (which is usually enabled by default on most Linux distros today). Emacs shell doesn't handle the vt100 escape codes.

Find out whether your ls command is aliased.

which ls

Does it look like like the following or something similar?

ls: alias to ls --color=tty

If so you'll need to find where this alias is set and unalias it or change how it is called.

Your shell knows it is running in an emacs shell if the EMACS environment setting is set to t. You can do something like the following to set alternate functions. I use zsh, so this contains some items specific to that shell.

## for emacs
if [[ $EMACS = "t" ]] then
   PROMPT="%# "  # make the prompt simple
   unsetopt zle  # turn off advanced line editting

   ls_pager=( cat ) # ls is simple piped to cat
   ls_flags=( -A )  # default ls flags

For bash you can you just alias ls

alias ls='ls -A'
share|improve this answer
+1 (Beat me, I was just typing in the same) But not as detailed... – Nifle Dec 16 '09 at 19:42
which ls /bin/ls I use bash and putting alias ls='ls -A' did not worked – Gok Demir Dec 16 '09 at 20:24
up vote 1 down vote accepted

I put ~/.emacs

(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

and it solved my problem. Anyway thanks for answering. The link that solved my problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.