so-fancy / diff-so-fancy

Good-lookin' diffs. Actually… nah… The best-lookin' diffs. :tada:
MIT License
17.36k stars 335 forks source link

Newer version of git are omitting the 0 (zero) in ANSI reset which breaks `$strip_leading_indicators` #469

Closed scottchiefbaker closed 1 year ago

scottchiefbaker commented 1 year ago

The ANSI sequence to "reset" is \e[0m. Optionally the 0 can be omitted \e[m, and it appears newer version of git are doing this.

Steps to reproduce:

echo "Hello world" > one.txt
echo "Hello Jason" > two.txt
diff -u one.txt two.txt | diff-so-fancy

With strip_leading_indicators enabled, the + / - at the start of the line are not removed. I'm running git v2.39.3 on Fedora.

scottchiefbaker commented 1 year ago

I guess this was already fixed in 5d567c1 which I hadn't pulled on my new test machine. Disregard.