bat
bat copied to clipboard
Support text with embedded ANSI codes for the higlight line
Good catch!
I suspect what's happening here is that the "tmux" there is actually:
^[[33m tmux ^[[0m
~~~~~~ ~~~~~
yellow reset
The reset (SGR RESET) clears all the style information, which happens to include the background set by the line highlight. It shouldn't be too hard to put the line highlighting styles back after we encounter a reset.
#2544 has some changes that would greatly assist in fixing this, so I'll address this after that gets merged.
I'm adding the colors, and there can be many added on a single line. Here's how it looks like
Hey @nkh, if it's not too much trouble, would you be able to provide me with a text file and theme to reproduce this issue?
I'm using your example above, and I can't seem to get it to break on the latest version of bat :
@eth-p I'll check with the latest version and get back to you.
Seems to work in 0.24, thanks.