solves #14901 illegible yellow string on yellow background issue#15156
Conversation
themavik
left a comment
There was a problem hiding this comment.
nit: ansiblack bg:ansiyellow fixes contrast on yellow-on-yellow; if a theme maps ansiblack oddly you get a new edge case — still likely better than the old single-token highlight.
|
Hi @themavik , thank you for your review comment. I understand that this solution isn’t fully theme-independent. Would you prefer that I make it theme-aware, for example, by adjusting the colors based on whether the user is using a light or dark theme? |
|
Hi @Carreau, I’ve updated the implementation to make the traceback highlight theme-dependent for the four built-in themes: Neutral, Linux, LightBG, and NoColor. theme_highlight_map = {
"linux": "ansiblack bg:ansiyellow",
"neutral": "ansiblack bg:ansiyellow",
"lightbg": "bg:ansiblue",
"nocolor": "",
}Would this approach be acceptable, or would you prefer a different way of wiring it into the theme system? Thanks for the review. |
|
You want to update
Then in you can probably do |
|
Hi @Carreau , I’ve made the requested changes based on your suggestions. I have added |
|
Thanks ! That might not make it to today's release, but probably for the next one. |
- Fill out whatsnew/version9.rst with all 6 milestone PRs: terminal image rendering via Kitty protocol (#15184), Python 3.11 support restoration (#15175), theme-aware color fix (#15156), CapturedIO type annotation fix (#15172), docs and contributing improvements - Mark release.py as a full release (_version_extra = "") https://claude.ai/code/session_016yXG8tqxaMuYxyw2bqZBEP
- Fill out whatsnew/version9.rst with all 6 milestone PRs: terminal image rendering via Kitty protocol (ipython#15184), Python 3.11 support restoration (ipython#15175), theme-aware color fix (ipython#15156), CapturedIO type annotation fix (ipython#15172), docs and contributing improvements - Mark release.py as a full release (_version_extra = "") https://claude.ai/code/session_016yXG8tqxaMuYxyw2bqZBEP

Fixes #14901

Before:
After:
