-
-
Notifications
You must be signed in to change notification settings - Fork 157
Add visual progress bar for TTY output #1510
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
base: main
Are you sure you want to change the base?
Conversation
|
@sferik I used to have a per subject progress bar back in the days and had lots of stability issues as terminal emulators where shit. Now as this one is a single one I suspect it'll not be a problem. Conceptually I'm fine with a more rich one and with the upcoming rust wrapper I'll also create them. But no reason to not release a ruby one meanwhile. But I need some people with various setup to test this. Lets create a small test command we can post here and ask some friends to post their arch/os/terminal results? I do not want to break reporting display for people "unknowingly". |
Replace periodic text-based progress output with a progress bar that updates in place when running in a TTY. It looks something like this: ``` RUNNING 45/100 (45.0%) ████████████░░░░░░░░░░░░ alive: 12 23.4s 1.89/s ```
Split StatusProgressive into Pipe and Tty subclasses to avoid checking tty? on every progress update. The TTY mode is static for the execution lifetime, so the appropriate printer class is now selected once at format initialization time.
b3a76ad to
2d94c98
Compare
Previously terminal width was detected once at startup and cached, causing the progress bar to render incorrectly when the terminal was resized during a mutation run. Now Format stores the output IO and queries winsize on each render, allowing the progress bar to adapt to terminal size changes.
|
Okay, this should be ready for re-review and testing on different platforms and terminal emulators. For what it's worth, my testing has been on macOS Tahoe (26.2). It works as designed on Ghostty (1.2.3), iTerm2 (3.6.6), and the default Apple Terminal (2.15). |
|
@mbj Any progress on this? |
nice pun, looking at it tomorrow, about to crash. |
Replace periodic text-based progress output with a (nextest-style) progress bar that updates in place when running in a TTY. It looks something like this:
It falls back to text format for non-TTY output.