ttacon/chalk

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

ttacon opened this issue · 1 comments

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

does not give the same output as:

chalk.Green.Color("✗")

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?