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

Fix bar width when using ANSI styling #160

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix bar width when using ANSI styling #160

wants to merge 1 commit into from

Conversation

jHoldroyd
Copy link

This fixes the issue when using colors that the progress bar will usually be collapsed. It strips the ANSI styling when calculating the available space and works with the raw data being displayed.

The regex was taken from: https://github.com/chalk/ansi-regex/blob/master/index.js#L3 and seems to work well.

CPatchane added a commit to cozy/create-cozy-app that referenced this pull request Jan 21, 2019
CPatchane added a commit to cozy/create-cozy-app that referenced this pull request Jan 21, 2019
CPatchane added a commit to cozy/create-cozy-app that referenced this pull request Jan 21, 2019
@ghost
Copy link

ghost commented Mar 13, 2022

Why this isn't pushed to npm ?

I had to fiddle with source code to find out why the output is shorter when using cli-colors. Thanks to this fix i was able to get it working quite easily although editing the source code manually is not a good idea.

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

Successfully merging this pull request may close these issues.

1 participant