Skip to content
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

Incorrect bar size when color is used in the title #24

Closed
Arnaud73 opened this issue Aug 31, 2023 · 3 comments
Closed

Incorrect bar size when color is used in the title #24

Arnaud73 opened this issue Aug 31, 2023 · 3 comments

Comments

@Arnaud73
Copy link

Color can be used for the bar, but if being used in the title, then the bar size is shorter.

E.g.:

const progress = new ProgressBar({
  total: 10,
  complete: green('='),
  incomplete: yellow('-'),
  display: `:completed/:total :title [:bar] :percent`,
});
let completed = 0;

for (const file of Array.from({ length: 10 }, (value, index) => index)) {
    progress.render(completed++, {
      title: `${yellow("file")} • ${blue("en!)} → ${blue("es")}`,
    });
  }

If the color used in the title are removed, then the bar is displayed correctly.

@fuxingZhang
Copy link
Collaborator

land at v1.3.9

@fuxingZhang
Copy link
Collaborator

fuxingZhang commented Aug 31, 2023

@Arnaud73
Copy link
Author

Thanks, I just tested, and it works flawlessly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants