小编Nic*_*nes的帖子

Emacs shell模式中的Python打开stty echo并打破Cd

当我在Emacs shell缓冲区(Mx shell)中运行交互式Python时,它会对TTY做两件令人惊讶的事情.首先,它打开输入echo,它在Python退出后仍然存在,直到我执行stty -echo.其次,它不接受Cd(或Cq Cd,即^ D)作为EOF:我必须键入quit()才能离开Python.我怎样才能阻止这两种行为呢?

我知道我可以运行python-shell,但我不想:我在shell中乱码,我想做五行Python然后用它来做Cd.所以"运行python-shell"不是我的问题的答案.

在终端窗口中运行的Python很好:^ D继续工作,回声不会改变.

Python 2.7.5,GNU Emacs 24.3.1,OS X 10.8.5

编辑从shell缓冲区添加此代码段:

bash-3.2$ echo foo 
foo                     # no echo.
bash-3.2$ cat
foo                     # I typed this.
foo                     # cat returned it; no additional echo.
bash-3.2$ python
Python 2.7.5 (default, May 19 2013, 13:26:46) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>                   # C-d has no effect. C-q C-d has no effect.
                      # not sure where …
Run Code Online (Sandbox Code Playgroud)

python macos emacs shell tty

13
推荐指数
1
解决办法
1077
查看次数

标签 统计

emacs ×1

macos ×1

python ×1

shell ×1

tty ×1