-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Plain code blocks do not render correctly on a light background #3123
Labels
Comments
This is as minimal as I can get it. Should have mentioned that this happens directly. It produces output just like what I showed.
|
Is this sufficient for your needs? |
It's not a minimally reproducable example if I cant cut and paste it. Regardless though, I can reproduce this on a light background. |
Merged
I hope we solved your problem. If you like using Rich, you might also enjoy Textual |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Markdown code blocks are rendering illegibly and ignoring any styling in the theme given to the console. The code has a black background and the text, rather than being a cyan, is just unstyled text. So on bright backgrounds this is effectively black on black (one can barely make out letter shapes); on dark backgrounds you see the text but not as styled. Inline markdown code displays fine and changes styles as expected. But neither the default code_block theme or any new theme attached to the console seems to change the output from none on black.
I've attached an image showing this. You can see the inline markdown code and the code block.
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Running on Mac OS 12.6.1. The same thing happens on standard Terminal and on ITerm2.
Note that the styles show up in
python -m rich.default_styles
, so it is not that the stylesare unable to display.
I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.
If you're using Rich in a terminal:
The output of the second one is 'rich==13.5.2'
The output of the first is
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface. │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ color_system = 'truecolor' │
│ encoding = 'utf-8' │
│ file = <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> │
│ height = 32 │
│ is_alt_screen = False │
│ is_dumb_terminal = False │
│ is_interactive = True │
│ is_jupyter = False │
│ is_terminal = True │
│ legacy_windows = False │
│ no_color = False │
│ options = ConsoleOptions( │
│ size=ConsoleDimensions(width=100, height=32), │
│ legacy_windows=False, │
│ min_width=1, │
│ max_width=100, │
│ is_terminal=True, │
│ encoding='utf-8', │
│ max_height=32, │
│ justify=None, │
│ overflow=None, │
│ no_wrap=False, │
│ highlight=None, │
│ markup=None, │
│ height=None │
│ ) │
│ quiet = False │
│ record = False │
│ safe_box = True │
│ size = ConsoleDimensions(width=100, height=32) │
│ soft_wrap = False │
│ stderr = False │
│ style = None │
│ tab_size = 8 │
│ width = 100 │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮
│ Windows features available. │
│ │
│ ╭───────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ ╰───────────────────────────────────────────────────╯ │
│ │
│ truecolor = False │
│ vt = False │
╰───────────────────────────────────────────────────────╯
╭────── Environment Variables ───────╮
│ { │
│ 'TERM': 'xterm-256color', │
│ 'COLORTERM': 'truecolor', │
│ 'CLICOLOR': None, │
│ 'NO_COLOR': None,
│ 'TERM_PROGRAM': 'iTerm.app', │
│ 'COLUMNS': None, │
│ 'LINES': None, │
│ 'JUPYTER_COLUMNS': None, │
│ 'JUPYTER_LINES': None, │
│ 'JPY_PARENT_PID': None, │
│ 'VSCODE_VERBOSE_LOGGING': None │
│ } │
╰────────────────────────────────────╯
platform="Darwin"
The text was updated successfully, but these errors were encountered: