Skip to content

Incorrect MultiBar.remove behaviour #149

@khokm

Description

@khokm
import cliProgress from "cli-progress";

// create new container
const multibar = new cliProgress.MultiBar(
    {
        clearOnComplete: false,
        hideCursor: true,
        format: " {bar} | {filename} | {value}/{total}",
    },
    cliProgress.Presets.shades_grey
);

const b1 = multibar.create(200, 0);
const b2 = multibar.create(1000, 0);

b1.update(0, { filename: "Task 1 in progress" });
b2.update(0, { filename: "Task 2 in progress" });

setTimeout(() => {
    // Task 1 completed, remove bar.
    multibar.remove(b1);
}, 1000);

Expected behaviour:
After 1 second only 'Task 2 in progress' caption should left on screen.
Actual behaviour:
After 1 second 'Task 1 in progress' caption is still on screen, but 'Task 2 in progress' removed instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions