Skip to content

Commit

Permalink
Fix: clear the last deleted progress bar (#773)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Oct 21, 2023
1 parent f3195da commit 6ea98dd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/console/progressBarCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,17 @@ export default class ProgressBarCLI extends ProgressBar {
* Stop the {@link MultiBar} (and therefore everyProgressBar).
*/
static async stop(): Promise<void> {
this.multiBar?.stop();
this.multiBar = undefined;
// Forcing a render shouldn't be necessary

// Freeze (and delete) any lingering progress bars
const progressBarsCopy = ProgressBarCLI.progressBars.slice();
await Promise.all(progressBarsCopy.map(async (progressBar) => progressBar.freeze()));

// Clear the last deleted, non-frozen progress bar
ProgressBarCLI.multiBar?.log(' ');
this.multiBar?.update();

this.multiBar?.stop();
this.multiBar = undefined;
// Forcing a render shouldn't be necessary
}

/**
Expand Down

0 comments on commit 6ea98dd

Please sign in to comment.