Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my emacs shell, I see this output:

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

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
add comment

2 Answers 2

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
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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.