Search code examples
ipython

IPython tab completion menu colors are unreadable


Tab completion in IPython and Jupyter-console is practically unusable because the text is so difficult to read.

enter image description here

Here's what I've tried:

  1. I didn't have an ipython configuration file so I created one: ipython profile create.
  2. In my ipython_config.py I set c.InteractiveShell.colors = 'NoColors'. That made all my text white but the completion text didn't change.

enter image description here

I'm using the following software:

  • kitty terminal: 0.14.1
  • IPython: 7.5.0
  • Pygments: 2.4.2
  • prompt-toolkit: 2.0.9

Solution

  • I found a solution. It seems my terminal is using 24bit color and that must be interacting poorly with the defaults of IPython which defaults to 256 colors. You can test your terminal with this command:

    printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
    

    If you see 'TRUECOLOR', then your terminal supports true color.

    For IPython, edit ~/.ipython/profile_default/ipython_config.py; for Jupyter, edit ~/.jupyter/jupyter_console_config.py. Then edit: c.TerminalInteractiveShell.true_color = True. Now the completion text is readable.

    enter image description here