vrothberg/vgrep

'vgrep --show' seems to not be able to parse colors

gregkh opened this issue · 12 comments

With 2.5.5 of vgrep, using vgrep --show results in an error:

WARN[0000] strconv.Atoi: parsing "\x1b[32m462\x1b[m": invalid syntax

Just checked, main also has this issue. Let me see if I can bisect...

odd, most older versions also cause this. I now notice that a search has multi-colored numbers (every other line is different), is that due to some other program causing that?

a local old copy of 2.3.0 seems to work, but when I check out 2.3.0 from here it fails. So this must be due to a dependency update somewhere.

Thanks for reaching out and sorry for the regression. It smells like some regex has changed and caused it but I need to look into it.

I couldn't find any version where this actually worked.

I now notice that a search has multi-colored numbers (every other line is different), is that due to some other program causing that?

vgrep does it but it has been like that for a long time. The idea was to facilitate reading the lines.

I am unable to find a version where colored input is accepted. Did something change in your environment?

I don't know, I'm running arch, and this seems odd as I "know" this used to work just fine.

It looks like the colored output is being saved in the cache file, let me dig and find out where that is coming from...

Ah, this looks to be a git thing!
--color=auto not --color=always. I'll make a real patch, give me a second...

Awesome, thanks for tracking it down!

Works for me, but some tests still fail when running make tests but that might just be because I do not have ripgrep installed here.

now resolved, thanks for the quick merge!