在 os-x 终端中运行 python repl (2.7.10) 并退出后,终端不再回显输入,并且发生了一些其他奇怪的事情。如果我python再次运行and exit(),则终端似乎已恢复。我现在只是关闭选项卡并打开一个新选项卡,所以我还没有进行广泛的测试。
我想这与终端设置有关,但这是最近的事情,我没有改变任何我记得的东西。macports如果与某些控制台库的不匹配依赖项有关,则Python 与 一起安装。2.7.10是前段时间安装的,安装后没有出现这种情况。
指关节开裂并打开terminal
[~]: virtualenv-2.7 venv-test
[~]: source venv-test/bin/activate
[~]: python
>>> ^D>>> *(press ctrl-d, the 2nd >>> is strange)
[~]: *(type something like `ls-l`, nothing shows on console)
[~]: -bash: ls-l: command not found`
Run Code Online (Sandbox Code Playgroud)
此外,再次运行 python 并ctrl-d在此输出中得到结果:
>>> ^D (ctrl-d, then hit enter, doesn't exit)
>>> ^D (...)
>>> ^D (...)
>>> exit() (typing exit() quits the session)
>>> [~]:
Run Code Online (Sandbox Code Playgroud)