chalk icon indicating copy to clipboard operation
chalk copied to clipboard

Possible issue with unicode width (Style() vs Color())

Open ttacon opened this issue 10 years ago • 1 comments
trafficstars

chalk.Green.NewStyle().Style("✗")

does not give the same output as:

chalk.Green.Color("✗")

ttacon avatar Jan 20 '15 16:01 ttacon

Hey, actually this is expected as when you create a new Style you initialize a background color of 0 which translates to \e[40m which is black.

So for the 2 cases the output will be: [40m[32m✗[49m[39m

and

[32m✗[39m

Respectively.

Do you still want a fix to ignore the background property if it's not set?

theodesp avatar Jun 15 '18 14:06 theodesp