配置IPython作为python-shell-interpreter

运行run-python会调出标准的Python shell

想要设置Ipython作为默认的shell

(setq python-shell-interpreter "ipython")

运行后报错:

Python 3.7.4 (default, Aug 13 2019, 20:35:49) Type ‘copyright’, ‘credits’ or ‘license’ for more information IPython 7.8.0 – An enhanced Interactive Python. Type ‘?’ for help.

WARNING: your terminal doesn’t support cursor position requests (CPR).

设置成(setq python-shell-interpreter “ipython”)也是同样的报错.

查询站内的帖子, 似乎设置后, 可以直接工作

reddit上只言片语, 没有解决方案

https://www.reddit.com/r/learnpython/comments/aybuc6/warning_your_terminal_doesnt_support_cursor/

emacs 26.3

1 个赞

ipython>=5 has a auto-complete feature which breaks the emacs sub-shell, you can fix this by changing this line python-shell-interpreter-args "--colors=Linux --profile=default" and add --simple-prompt .

It will allow you to see ipython correctly but for some reason I did not get yet the auto-completion in emacs is not as effective as it used to be.

2 个赞