Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPython tab completion menu colors are unreadable

Tags:

ipython

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
like image 927
Jacques Kvam Avatar asked Jul 19 '26 23:07

Jacques Kvam


1 Answers

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

like image 150
Jacques Kvam Avatar answered Jul 25 '26 00:07

Jacques Kvam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!