pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ipython/ipython/pull/15156

ets/global-0bd78641c0a1f3e0.css" /> solves #14901 illegible yellow string on yellow background issue by GSAUC3 · Pull Request #15156 · ipython/ipython · GitHub
Skip to content

solves #14901 illegible yellow string on yellow background issue#15156

Open
GSAUC3 wants to merge 3 commits intoipython:mainfrom
GSAUC3:bug-14901
Open

solves #14901 illegible yellow string on yellow background issue#15156
GSAUC3 wants to merge 3 commits intoipython:mainfrom
GSAUC3:bug-14901

Conversation

@GSAUC3
Copy link
Copy Markdown

@GSAUC3 GSAUC3 commented Mar 14, 2026

Fixes #14901
Before:
6174511424038703085

After:
6174511424038703086

@GSAUC3
Copy link
Copy Markdown
Author

GSAUC3 commented Mar 23, 2026

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?
I also noticed that merging is currently blocked. Could you please let me know what might be causing this? I created a separate branch before opening the PR, so I’d appreciate any guidance on what I might have missed.

@Carreau
Copy link
Copy Markdown
Member

Carreau commented Mar 25, 2026

unfortunately this works for you, but not on all terminal themes, in some case this is worse:

Screenshot 2026-03-25 at 11 04 09

Maybe update tb_highlight and tb_highlight_style to be settable as part of the theme for flexibilty

@Carreau Carreau marked this pull request as draft March 25, 2026 15:03
@GSAUC3
Copy link
Copy Markdown
Author

GSAUC3 commented Mar 25, 2026

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.

@Carreau Carreau marked this pull request as ready for review March 26, 2026 06:43
@Carreau
Copy link
Copy Markdown
Member

Carreau commented Mar 26, 2026

You want to update class Theme in pycolorize to either:

  • add a tb_highlight attribute
  • or allow a Token.TbHighlight: str entry in the style dict (I think I prefer this one, but I could be convinced otherwise)

Then in

base_style = theme_table[self._theme_name].as_pygments_style()
style = stack_data.style_with_executing_node(base_style, self.tb_highlight)

you can probably do style_with_executing_node(base_style, theme_table[self._theme_name].get('tb_highlight', self.tb_highlight) or theme_table[self._theme_name].as_pygments_style()[Token.TbHighlight] or similar.

@Carreau Carreau marked this pull request as draft March 26, 2026 12:52
@GSAUC3
Copy link
Copy Markdown
Author

GSAUC3 commented Mar 27, 2026

Hi @Carreau , I’ve made the requested changes based on your suggestions. I have added Token.TbHighlight to the style_extra dictionary for each theme. Please let me know if there’s anything else you’d like me to modify. I’d be happy to help. Thanks again for your feedback.

@Carreau Carreau marked this pull request as ready for review March 27, 2026 08:59
@Carreau
Copy link
Copy Markdown
Member

Carreau commented Mar 27, 2026

Thanks ! That might not make it to today's release, but probably for the next one.

@Carreau Carreau added this to the 9.13 milestone Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IPython 9.x produces illegible yellow string on yellow background in tracebacks

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy