7

I'm in Mac OS X 10.10, using python3 installed using Macports.

There is something really strange going on when I start the interactive python3 shell. When starting python3 and runs anything (even non-syntactical commands), something happens to the terminal such that

  1. I cannot see any newlines while hitting Enter
  2. Anything I write doesn't show while typing, but will still be executed when hitting Enter.

This problem persists in the underlying bash shell, after closing the python3 shell (using e.g. Ctrl-D). What makes this even "funnier" is that starting regular python afterwards (version 2.7 by the way), the problem solves itself – the terminal behaves as it should.

Has anyone seen this, has any suggestion what might have happened and hopefully knows a way to resolve this? Thank you.

gustafbstrom
  • 1,622
  • 4
  • 25
  • 44
  • I cannot reproduce the problem in Python 3.4.3, installed on Mac OS 10.10.5 via Homebrew. – jub0bs Sep 09 '15 at 10:37
  • @Jubobs No, I know it's hard to reproduce – either one has a problem with this, or one doesn't… Hopefully, someone might recognize the behavior. – gustafbstrom Sep 09 '15 at 10:46

2 Answers2

6

Yep, I see this problem too using python3.5 on Mac OS X 10.10.

This seems to be a bug with the python3 interactive shell - it disables echo for your terminal and does not enable it when you exit(). To fix your terminal, run this command at the bash prompt.

stty echo

Credit goes to this post.

UPDATE:
This bug is tracked here: https://trac.macports.org/ticket/48807
The permanent fix is to install the port py35-readline.

sudo port install py35-readline
Community
  • 1
  • 1
amath
  • 1,279
  • 9
  • 14
0

To fix your terminal, run this command at the bash prompt

stty sane

Credit goes to this post

Berni Gf
  • 161
  • 1
  • 5