-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Describe the bug
The terminal 'rxvt-unicode-256color' is not correctly identified as having 256 color support, because the code doesn't expect the base terminal name (rxvt-unicode) to have a hyphen (https://github.com/willmcgugan/rich/blob/master/rich/console.py#L773).
To Reproduce
Run urxvt from the rxvt-unicode-256 package.
Platform
Linux
Diagnose
$ python -m rich.diagnose
│ color_system = 'standard' │
│ is_interactive = True │
│ is_terminal = True │
│ no_color = False |
$ python -m rich._windows
platform="Linux"
WindowsConsoleFeatures(vt=False, truecolor=False)
$ pip freeze | grep rich
rich==8.0.0
Recommendation
Query the terminal capabilities more directly, e.g.:
try:
import curses
curses.setupterm()
num_colors = curses.tigetnum('colors')
except ModuleNotFoundError:
pass
Reactions are currently unavailable