gay
gay copied to clipboard
Permit ANSI escape codes through unharmed
Before:
After:
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 https://github.com/ms-jpq/gay/issues/11