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

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

Open
ttacon opened this issue Jan 20, 2015 · 1 comment
Open

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

ttacon opened this issue Jan 20, 2015 · 1 comment
Assignees

Comments

@ttacon
Copy link
Owner

ttacon commented Jan 20, 2015

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

does not give the same output as:

chalk.Green.Color("✗")
@ttacon ttacon self-assigned this Jan 20, 2015
@theodesp
Copy link

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?

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