Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kitt-cat
Copy link

@kitt-cat kitt-cat commented Nov 5, 2022

Before:
Selection_032
After:
Selection_031

Well, mostly. Doing this correctly would likely require a full implementation of dozens of escape code specifications but this hack should cover most cases.

There is room improvement in that pre-existing SGR codes are not stripped out; the codes gay adds just happens to override them. Stripping out exactly the right codes is difficult because multiple attributes can be set in one code, so codes which set, for example, both foreground color and bold/increased intensity would have to be parsed and split apart.

Fixes #11

Well, mostly. Doing this correctly would likely require a full
implementation of dozens of escape code specifications but this hack
should cover most cases.

There is room improvment in that pre-existing SGR codes are not stripped
out; the codes gay adds just happens to override them. Stripping out
exactly the right codes is difficult because multiple attributes can be
set in one code, so codes which set, for example, both foreground color
and bold/increased intensity would have to be parsed and split apart.
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.

Support for colored outputs

1 participant