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(colors): send full style reset in diff #32

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

imsnif
Copy link
Member

@imsnif imsnif commented Nov 9, 2020

This addresses #15

What caused this issue was that apparently one is able to set the font color using the bold code. As in, while [1m is "set to bold", [1;32m is "set to red bold". But the bold reset code [22m (that which I initially thought would reset whatever one places in [1m) only resets the bold and not the red.

Because of that assumption of mine, in the case of starship we were only sending the reset code for bold and thus the color stayed red when it wasn't supposed to.

To solve this, when we decide which styles to send to a new character (we do this by diffing the styles with the previous character, because styles stick around until they are reset), if the new character is a full reset, we send a full reset rather than bothering with the diff.

@imsnif imsnif merged commit b876843 into zellij-org:main Nov 9, 2020
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.

None yet

1 participant