Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

In my emacs shell, I see this output:

^[[J~% echo $PS1
echo $PS1

On my other machine, this stuff doesn't show up at all. Can anyone suggest a reason why and how to fix it?

share|improve this question
I'd test the shells, do echo $0 in both windows, make sure the shells are the same. – Rich Homolka Jun 27 '12 at 17:46

Your shell startup script is configuring the PS1 variable to output escape sequences as part of the prompt (perhaps to do colorized text or reverse video). An Emacs buffer can't do those things (at least not with escape sequences), so instead you see the raw escape sequence. You should be able to test the value of environment variable TERM in your shell startup code that is setting PS1. If the value of variable TERM is emacs, then don't insert the escape sequences into PS1.

share|improve this answer

You might also try going to the shell buffer and doing M-x ansi-color-for-comint-mode-on.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .