You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use a less red-ish color for the new prompt and non-error colorized traceback text #118626
I noticed that the magenta color used by the new REPL and within the non-error text in the new colorized tracebacks in 3.13 looks quite a bit like an error-related color in some popular color schemes.
Here's an image which shows how an error message displays in a few fairly popular terminal color schemes.
I've included both "bold as bright" and not.
Some terminal emulators enable that setting by default while others do not.
Here are 3 more images showing how the prompt and error messages would display if cyan, blue, or green were used instead of magenta.
I couldn't find data on which color schemes are the most widely used, so I took my best guesses from a bit of research.
From the schemes I looked at (Dracula, Nord, Solarized Dark/Light, Gruvbox Dark/Light) I think Cyan, Blue, or Green would look the least like red.
I don't want to start a debate over what color to paint the bike shed, but I think the closeness of the magenta and red colors are important enough to discuss before 3.13.0 lands.
I'm trying to mirror something like GitHub's pytb colour groups to avoid having too many colours:
>>> 4 / 0
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>4/0~~^~~ZeroDivisionError: division by zero
>>>
>>> 3.to_bytes(1, 'little')"
File "<string>", line 13.to_bytes(1, 'little')
^SyntaxError: invalid decimal literal
In the before and after below, I'm using macOS and have iTerm with a dark theme, and Terminal with light theme (Novel), to make it easy to compare without having to dig in the settings each time.
Activity
nineteendo commentedon May 6, 2024
Hmm, sounds more like an enhancement than a bug.
hugovk commentedon May 6, 2024
Regarding bug/feature, I think this is something we can tweak during beta, so let's keep the bug label.
I like the suggestion. We could keep the exception name (
ZeroDivisionError) magenta/red-ish.For example compare GitHub's
pytbhighlighter:I think Pygments does something similar.
treyhunner commentedon May 6, 2024
I agree that the exception name, and even the exception message, in magenta or red seems very appropriate.
hugovk commentedon Jun 2, 2024
Here's a suggestion.
I'm trying to mirror something like GitHub's
pytbcolour groups to avoid having too many colours:In the before and after below, I'm using macOS and have iTerm with a dark theme, and Terminal with light theme (Novel), to make it easy to compare without having to dig in the settings each time.
What do you think?
hugovk commentedon Jun 3, 2024
And a longer traceback using this script based on a test:
2.py
pytb
hugovk commentedon May 4, 2025
Closing in favour of theming support: #133346