Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

cli.progress creating a new line on each update #319

@jacquesfu

Description

@jacquesfu

running one of the examples from the cli.progress repo results in each update to the bar graph showing up as a separate line instead of updating the existing line.

progress [----------------------------------------] 1% | ETA: 15s | 1/100
progress [==--------------------------------------] 5% | ETA: 5s | 5/100
progress [====------------------------------------] 10% | ETA: 2s | 10/100
progress [======----------------------------------] 14% | ETA: 3s | 14/100
progress [=======---------------------------------] 18% | ETA: 2s | 18/100
progress [=========-------------------------------] 23% | ETA: 2s | 23/100

sample code:

    const bar = cli.progress();
    bar.start();
    let value = 0;
    const timer = setInterval(() => {
      value++;

      // update the bar value
      bar.update(value);
      if (value >= bar.getTotal()) {
        // stop timer
        clearInterval(timer);

        bar.stop();
      }
    }, 20);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions