Closed s-ff closed 1 month ago
does the rich Console
expect to own stderr and that all writes to it go through the console instance? Or can a console be freely mixed with raw print
calls (to stderr)?
we can test by having an active spinner (or rich progress bar) and also writing to the output stream directly, and then observing if the spinner is correctly cleaned up/rendered near the new lines.
does the rich Console expect to own stderr and that all writes to it go through the console instance? Or can a console be freely mixed with raw print calls (to stderr)?
we can test by having an active spinner (or rich progress bar) and also writing to the output stream directly, and then observing if the spinner is correctly cleaned up/rendered near the new lines.
I did an expriment for this, and concluded that rich.console.Console
can freely be mixed with raw print
to stderr.
Does this answer your question @williballenthin?
wow that's great!
thanks @s-ff!
This PR is a candidate replacement for Halo spinner as discussed in #1812. It uses Rich module.
If we end up adopting rich, we could maybe use some of its other features to reduce dependencies, for example replacing
tqdm
withrich.progress
andtabulate
withrich.table
. It could also serve to implement a pager functionality for long output texts.Checklist