IPython shell 的换行问题
如果我在 IPython 中运行了很长的一行,并尝试调用它(使用向上箭头)或在当前行的开头之外退格,它会显示不正确(全部挤成一行)
例如,在以下会话中我写了一个长行 [1]
,输入了一个有点空白的行 [2]
,然后向上箭头两次以获取 print
语句[3]
行,发生以下情况:
iTerm 和终端中均发生.app ..我在常规终端会话中遇到了类似的问题,该问题通过正确终止颜色代码来修复,但我不确定如何使用 IPython 修复它
If I have run a long line in IPython, and try and recall it (using the up-arrow) or backspace beyond the start of the current line, it displays incorrectly (all smushed into one line)
For example, in the following session I wrote a long line [1]
, entered a somewhat-blank line [2]
, then up-arrowed twice to get the print
statement on line [3]
, and the following happened:
Happens in both iTerm and Terminal.app.. I had a similar problem with regular terminal sessions, which was fixed by properly terminating colour codes, but I'm not sure how to fix it with IPython
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
啊哈! 我有一个旧版本的 Python readline 模块 - 从 http://ipython.scipy.org/dist 安装最新版本/ 效果非常好!
Aha! I had an old version of the Python readline module - installing the latest from http://ipython.scipy.org/dist/ and it works perfectly!
在雪豹上遇到这个问题。 从 http://pypi.python.org/pypi/readline/ 修复它:
Got this problem on Snow Leopard. Installing a new version of readline from http://pypi.python.org/pypi/readline/ fixes it:
我无法重现它(向上箭头适用于 ipython 中的长行):
I can't reproduce it (up-arrow works for long lines in ipython):