Redraw a finished bar below a warning for its last file (closes #102)
check / check (push) Waiting to run
check / check (push) Waiting to run
On a terminal, warnf clears the bar's line before it prints a warning. When the warning is for the last item of a phase, the bar has already drawn its finished frame and the progress library draws nothing more for a finished bar, so the warning took the bar's place for good. warnf now draws the finished bar's last frame again below the warning. Output when stderr is not a terminal does not change. Model: opus-5-5
This commit was merged in pull request #103.
This commit is contained in:
@@ -139,6 +139,13 @@ func (p *progress) warnf(format string, args ...any) {
|
||||
}
|
||||
|
||||
fmt.Fprintln(os.Stderr, msg)
|
||||
|
||||
// The library never draws a finished bar again, so the warning for
|
||||
// a pass's last item would erase it for good: draw its last frame
|
||||
// again below the warning.
|
||||
if p.bar != nil && p.bar.IsFinished() {
|
||||
fmt.Fprint(os.Stderr, p.bar.String())
|
||||
}
|
||||
}
|
||||
|
||||
// finish terminates the pass's display. A bar whose pass stopped short
|
||||
|
||||
Reference in New Issue
Block a user