12

What is happening:

>>> 2 * 10
2 * 10
20
>>> 

What I want to happen:

>>> 2 * 10
20
>>> 

Does anyone know why the command is printed out before being executed and how to stop it from doing that? I can't find any documentation about this. I'm using Emacs 23 on Mac OS X with Python 2.7.

3
  • 2
    How are you starting the Python process? run-python, python-shell? Commented Nov 9, 2011 at 6:06
  • 2
    Another way is to start ansi-term and then ipython inside it. Commented Nov 9, 2011 at 8:31
  • Well, I didn't know about ansi-term. I've been using M-x shell so thanks for that. Commented Nov 9, 2011 at 17:19

1 Answer 1

12

I don't use python, but I would guess that the python feature you are using has set the variable comint-process-echoes incorrectly. Whatever the value in your buffer is, just reverse the boolean value.

Comint is a support library in Emacs for running inferior processes in Emacs. It interacts with the prompts, and the python shell (or M-x shell) needs to be told about the echo feature.

In your shell buffer with the problem, do:

M-: (setq comint-process-echoes t)  ;; or nil
Sign up to request clarification or add additional context in comments.

3 Comments

This works for me, too! I wonder if you can help with my question which regards running this in a hook every time python starts up?
@Eric I am using Elpy on Emacs in ubuntu I do have the same problem but this solution is not working.Can help me out
I have found solution by setting the variable elpy-shell-echo-input to nil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.