rich
rich copied to clipboard
[BUG] Plain code block unreadable with light profile
Describe the bug
Using light Terminal/iTerm profile plain code block is unreadable (dark text on dark background).
Given README.md with following content:
# Test
```ruby
some = :code
```
```
some
text
```
some
text
Running cat README.md | python -m rich.markdown -.
Produces:
Platform
Click to expand
Running on macOS 12.3.1 using Terminal 2.12.5
python -m rich.diagnose:
╭───────────────────────── <class 'rich.console.Console'> ─────────────────────────╮
│ A high level console interface. │
│ │
│ ╭──────────────────────────────────────────────────────────────────────────────╮ │
│ │ <console width=97 None> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ color_system = None │
│ encoding = 'utf-8' │
│ file = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'> │
│ height = 42 │
│ is_alt_screen = False │
│ is_dumb_terminal = False │
│ is_interactive = False │
│ is_jupyter = False │
│ is_terminal = False │
│ legacy_windows = False │
│ no_color = False │
│ options = ConsoleOptions( │
│ size=ConsoleDimensions(width=97, height=42), │
│ legacy_windows=False, │
│ min_width=1, │
│ max_width=97, │
│ is_terminal=False, │
│ encoding='utf-8', │
│ max_height=42, │
│ justify=None, │
│ overflow=None, │
│ no_wrap=False, │
│ highlight=None, │
│ markup=None, │
│ height=None │
│ ) │
│ quiet = False │
│ record = False │
│ safe_box = True │
│ size = ConsoleDimensions(width=97, height=42) │
│ soft_wrap = False │
│ stderr = False │
│ style = None │
│ tab_size = 8 │
│ width = 97 │
╰──────────────────────────────────────────────────────────────────────────────────╯
╭─── <class 'rich._windows.WindowsConsoleFeatures'> ────╮
│ Windows features available. │
│ │
│ ╭───────────────────────────────────────────────────╮ │
│ │ WindowsConsoleFeatures(vt=False, truecolor=False) │ │
│ ╰───────────────────────────────────────────────────╯ │
│ │
│ truecolor = False │
│ vt = False │
╰───────────────────────────────────────────────────────╯
╭──────── Environment Variables ────────╮
│ { │
│ 'TERM': 'xterm-256color', │
│ 'COLORTERM': None, │
│ 'CLICOLOR': '1', │
│ 'NO_COLOR': None, │
│ 'TERM_PROGRAM': 'Apple_Terminal', │
│ 'COLUMNS': None, │
│ 'LINES': None, │
│ 'JPY_PARENT_PID': None, │
│ 'VSCODE_VERBOSE_LOGGING': None │
│ } │
╰───────────────────────────────────────╯
platform="Darwin"
pip freeze | grep rich:
rich==12.4.1