node-progress icon indicating copy to clipboard operation
node-progress copied to clipboard

Fix bar width when using ANSI styling

Open jHoldroyd opened this issue 7 years ago • 1 comments

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.

jHoldroyd avatar Aug 14 '17 02:08 jHoldroyd

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.

ghost avatar Mar 13 '22 00:03 ghost