Remove code that tries to handle ANSI escape inputs#2189
Remove code that tries to handle ANSI escape inputs#2189
Conversation
|
So what are the things that couldn't be done anymore when removing the special ANSI sequence handling? CC @eth-p |
|
Apart from the use case I described from the start, I know of no additional use of the ANSI escape handling code. And worth emphasising: the current code breaks the use case in #2185. I suppose it is possible to fix it. But is it worth it? I would also greatly appreciate any input you might have here @eth-p. |
Oh, sorry. I misread your post. I understand now. |
|
No objections have been raised, so I think we can go ahead and merge this. We can always change our mind later and bring back the code, if we want to. I will wait another week or so, and then rebase and merge this unless any objections are raised. 3 months has passed since last release, and there a bunch of nice fixes waiting to be released, so it would be nice to get a release out in the coming weeks, IMHO. |
61e058f to
4fd7f22
Compare
Syntax highlighting is broken when input contains ANSI escape characters anyway, so there is not much point in trying to handle ANSI escapes in input.
4fd7f22 to
8174e02
Compare
Proof of concept to aid discussion in #2185. I have not made up my mind yet if this change in sensible, but I think it helps to see it in person. Make sure to ignore whitespace changes when diffing.
IMO this problem is not a blocker to get the v0.21.0 release out since this is not a change in behaviour compared to v0.20.0.
The main use case for the old code seems to be that colored input across newlines should be handled correctly. If you try this:
it looks like this with
cat:and the same with the latest release of
bat, but with the code in this PR it looks like this instead:since we reset colors when we encounter
\nit seems. But IMHO we should just consider ANSI escape inputs as out-of-scope for bat, since syntax highlighting is broken when input contains ANSI escape characters anyway.I have also confirmed that this change makes
batshowbat-bug-testin #2185 the same way ascat.