Specifically, prevent other attributes from leaking into the
bold/dim/italic/underline attributes, and ensure that bright backgrounds
are put into the background attribute instead of the foreground
attribute.
This commit strips OSC (Operating System Command) sequences before
printing lines. Eventually when time permits, I want to add back
support for printing OSC sequences (and improve it to treat hyperlinks
like an attribute).
Until then, this should help prevent garbled output :)
This can be used to extract a subset of ANSI escape sequences from a
string of text. I have big plans for this eventually, but for now, it'll
be used to strip OSC before printing.
This reverts commit 8174e022797924aec735ff440806920767f80496. Turns out
it is needed for a common use case, see
https://github.com/sharkdp/bat/issues/2307.
It is not a clean revert, because I adjust CHANGELOG.md and also add a
comment to the test. I also had to resolve a small `use` conflict.