ANSI escape color codes, e.g. "\u001b[31m", are incorrectly printed in the Python REPL, inferior python mode. They are correctly printed in VTerm, where they are displayed the same as when printed in the terminal of my operating system.

I have tried changing ansi-color-names-vector, but whatever changes I make to it, it makes no difference.

I have tried changing the emacs theme, but it makes no difference.

To the left: ANSI colors correctly displayed in vterm.

To the rigth: ANSI colors incorrectly displayed, or missing, in Inferior Python mode. enter image description here

I suppose that 256-bit color support might a different issue than the colors being displayed incorrectly. Just correcting the colors would help a lot, though 256-bit support would be nice too.

  • It's possible the differences are because you're using two different "systems" to "render" the colors; libvterm with vterm and "emacs" with Emacs. (Though the colors in inferior python do look bad.) Some things to try: use emacs -Q and the bare minimum to do your comparison, definitely avoid loading themes. Running Emacs as normal, use shell or eshell instead of vterm. Also, providing some more info about which "python mode" you're using might be helpful. – nega May 11 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.