I will frequently use IPython.embed()
to examine the state of running code. In earlier versions of IPython, it correctly determines color capability of my terminal (xterm), and uses colored text. In the latest version of IPython (7.2.0), only black and white text are shown when using IPython.embed()
.
Based on the documentation, I should be able to override this default in the default profile by setting c.InteractiveShell.colors = 'Linux'
. However, this setting only applies to standalone instances of IPython, and not embedded sessions.
I can correct this for each instance by using the %colors Linux
magic method. However, this should work automatically without needing additional configuration after each embed.
If I start a standalone instance of IPython by running ipython3
directly, then the terminal colors are correctly set. However, this is not an option for my most common workflow.
This was tested using python 3.5.2, running on Linux Mint 19 (based on Ubuntu 18.04). The first ipython version on PyPI where this occurred is version 7.0.0. The previous version available, 6.5.0, correctly uses terminal colors with IPython.embed()
. For now, I have reverted to the last working version of 6.5.0, but I would like to keep up-to-date on the most recent version.