Various improvements in usage of Rich in Red #4726
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!4726
Loading…
Reference in a new issue
No description provided.
Delete branch "V3/rich_improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
Will fix #4702 once this PR gets finished.
Done:
--rich-traceback-extra-lineswhich allows setting the number of additional lines of code before and after the executed line that should be shown in traceback generated by Rich (defaults to 0 which means showing only one line per stack level, similarly to regular Python tracebacks--rich-traceback-show-localswhich allows to enable showing local variables in tracebacks generated by Rich which can be useful when developing for RedNO_COLORenvironment variable--rich-traceback-extra-linesflag)(_)in Red-DiscordBot splashNotes:
Bold on Windows isn't actually bold, Windows instead uses a different shade of the color when text is bolded.
Figuring out the right colors for everything in Rich so that it is all readable on the most common terminals (see the list in the issue description) is the only thing left to do here but it's also the most troublesome one. I'll be trying to look into it in the coming days, but I would appreciate all the help with figuring out something that looks acceptable and is not hard to see on different applications. Hopefully, we'll figure something out :/
I can't really test colors on Mac OS X so I would appreciate it if someone could run the bash script below.
Little code pieces for testing the standard 8 colors and their bright and bolded variants:
Unix:
Windows (should work on both CMD and PowerShell):
Default color scheme screenshots
Most important terminals
Default color scheme screenshots





Windows - CMD:
Linux - tty console
Linux - LXTerminal with Raspberry Pi OS's color scheme
Mac - Terminal (Catalina)
Mac - Terminal (supposedly, Big Sur on dark mode)
Less important terminals
Windows - PowerShell:






Linux - LXTerminal with its default color scheme
Linux - KDE Konsole
Linux - Gnome Terminal with Ubuntu's color scheme
Linux - Gnome Terminal with its default color scheme
Linux - xterm
And last but not least...

Cool Retro Term! :D
Here's a first take on the syntax theme colors...
Would love to hear some feedback, as I made those from scratch and I honestly don't know if these are any good, nor what should possibly be changed.
Most important terminals
Windows - CMD:




Linux - tty console:
Linux - LXTerminal with Raspberry Pi OS's color scheme:
Mac - Terminal:
Less important terminals
Windows - PowerShell:





Linux - LXTerminal with its default color scheme:
Linux - KDE Konsole:
Linux - Gnome Terminal with Ubuntu's color scheme:
Linux - Gnome Terminal with its default color scheme
The bright cyan on mac default (white) is difficult to read and hard on the eye. Other than that everything else is looking good
I made the proposed changes and here are screenshots of the updated color scheme on different terminals.
Most important terminals
Windows - CMD:




Linux - tty console:
Linux - LXTerminal with Raspberry Pi OS's color scheme:
Mac - Terminal:
Less important terminals
Windows - PowerShell:






Linux - LXTerminal with its default color scheme:
Linux - KDE Konsole:
Linux - Gnome Terminal with Ubuntu's color scheme:
Linux - Gnome Terminal with its default color scheme:
Linux - Cool Retro Term :D
If this looks alright, I'll proceed with getting screenshots of the whole Rich output on different terminals, including truecolor monokai color scheme on terminals that support it.
I prepared a script that produces output using our styles and Red-like messages which can be used to produce repeatable output without having to install Red in whole. I'll be checking this on all the different terminals which I've already been presenting above. If the used terminal supports true colors, the screenshots will be generated for both the true color variant and the standard 16 colors variant.
https://gist.github.com/jack1142/302f2f4650eab57776b528aae98219fb
I'll be coming with another update soon™
Alright, here it is... Red output with Rich tables, logging, colors on all terminals that I've been posting screenshots for before.
Most important terminals
Less important terminals
This should now be ready for review. PR description has been updated appropriately.
Soft approve, I did not do a full review but this seems to work from my basic testing, and I like the changes.
Looks good to me!