terminal - 如何在 IPython shell 上更改 iTerm2 的颜色?

标签 terminal ipython iterm2

我想更改 iTerm2 上 IPython shell 的颜色,但是虽然我可以更改 iTerm2 的颜色,但无法更改 IPython shell 的内容。

iTerm2 颜色可以从首选项 | 更改简介 | Window,但无论我选择什么配色方案都不会改变 IPython shell 的颜色,例如 importtry 关键字。

所以我认为这是在其他地方决定的。如何更改 IPython shell 的颜色?

最佳答案

通过 TerminalInteractiveShell.highlighting_style 更改。我将以下内容设置为我的 ipython_config.py:

c.InteractiveShell.colors = "Linux"
c.TerminalInteractiveShell.highlighting_style = "vim"

可以通过以下代码获取TerminalInteractiveShell.highlighting_style的可用颜色:

import pygments
list(pygments.styles.get_all_styles())

关于terminal - 如何在 IPython shell 上更改 iTerm2 的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51198249/

相关文章:

c - 如何在终端 : 中使用它

Python 通过子进程或其他方法加速命令行调用

Git 庆典错误 : Could not fork child process: There are no available terminals (-1)

django - 如何为 Django 设置 Jupyter/IPython Notebook?

linux - IPython 检查运行脚本的用户是否是 root 用户 (Linux)

terminal - Iterm2 首选项 : Show bar with directory, 日期和 git

c++ - 如何在另一个终端中从 C++ 打开和稍后关闭另一个程序?

ipython notebook 在单元格之间导航

macos - 如何使用iterm2使用触控板在nano中滚动,就像在terminal.app中的工作方式一样?

tabs - iTerm 选项卡切换顺序