gay icon indicating copy to clipboard operation
gay copied to clipboard

Permit ANSI escape codes through unharmed

Open gandalf3 opened this issue 2 years ago • 0 comments

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 https://github.com/ms-jpq/gay/issues/11

gandalf3 avatar Nov 05 '22 00:11 gandalf3