Visitar URL original
How to set a theme? · Issue #15197 · ipython/ipython · GitHub
Skip to content

How to set a theme? #15197

Description

@klonuo

I first searched the docs and as I couldn't find walkthrough I googled:

how to set gruvbox-dark as default theme

To set gruvbox-dark as your permanent default theme in IPython, you need to modify your configuration file.
As of IPython 9.0+, the theme system has been unified. Add or uncomment the following line in your ipython_config.py:

c.TerminalInteractiveShell.theme_name = 'gruvbox-dark'

If you are on an older version of IPython (pre-9.0), you may need to set the highlighting_style instead:

c.TerminalInteractiveShell.highlighting_style = 'gruvbox-dark'

I use Ipython 9.13 and got error about the theme you suggested: [TerminalIPythonApp] WARNING | Config option theme_name not recognized by TerminalInteractiveShell.

In IPython 9.x, the configuration option theme_name was introduced specifically for the TerminalIPythonApp class, rather than TerminalInteractiveShell. [1, 2] 
To fix the "Config option not recognized" error in your ipython_config.py, change the class prefix from TerminalInteractiveShell to TerminalIPythonApp:

c.TerminalIPythonApp.theme_name = 'gruvbox-dark'

[TerminalIPythonApp] WARNING | Config option theme_name not recognized by TerminalIPythonApp

The error occurs because IPython 9.13 (and the 9.x series) [renamed several configuration options](https://ipython.readthedocs.io/en/9.0.2/config/details.html) during the transition to the new theme system. While the command-line flag is --theme, the configuration file parameter for the standard terminal is typically handled by the TerminalInteractiveShell class or its base apps. [1] 
If both TerminalIPythonApp and TerminalInteractiveShell are failing to recognize theme_name, try these two standard methods for IPython 9.x:

In many 9.x builds, the theme is still technically mapped through the high-level highlighting configuration. Try adding this to your ipython_config.py:

c.TerminalInteractiveShell.highlighting_style = 'gruvbox-dark'

..\IPython\terminal\interactiveshell.py:356: UserWarning: highlighting_style is deprecated since 9.0 and have no effect, use themeing.

To fix this in IPython 9.13, you must use the updated [theme configuration system](https://ipython.readthedocs.io/en/9.0.1/config/details.html) which replaces the now-deprecated highlighting_style. [1, 2] 
The theme_name attribute was recently added to the InteractiveShell class to unify color handling. Update your ipython_config.py with this exact line: [3] 

c.InteractiveShell.theme_name = 'gruvbox-dark'

To complete the loop with Google assistant.

Activity

  1. vblazhkun commented on Aug 14, 2026

    @vblazhkun

    It seems the only option at the moment is to use something like c.TerminalInteractiveShell.colors = 'linux'. I was not able to supply any arbitrary color scheme name from the Pygments library though (only hardcoded ones listed in the docs).

  2. Marwan-verse commented on Sep 26, 2026

    @Marwan-verse

    I’ve opened PR #15404 with a docs example for setting a profile’s default theme using c.InteractiveShell.colors = "gruvbox-dark". It also explains that the configuration trait is named colors, while the command-line option is available as --theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions