New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enconding problems with color.diff.meta #361
Comments
What terminal are you using? The dash character it draws is a unicode character which may cause problems with some terminals. You can see it in action here. |
I'm using MIGW64 so underneath it should be the default Windows Terminal.
|
There is also this config option. |
I got it running for me (with the unicode symbol) by removing the meta option. I didn't tested if a color value given to meta produces valid output.
Just for the record: With .meta = 11 every mingw window and also every other instance of cmd or powershell shows broken glyphs. Even when git isn't running. Very strange o.O
|
This happened for me as well. I'm using:
Setting |
Do you see the same issue with |
I ran the PowerShell equivalent and got this: I also ran it in Git Bash (still via Windows Terminal) and got this: Possibly related, if I attempt to use a number to specify a highlight background color (e.g. This occurs in both PowerShell and Git Bash. I'm not certain whether it's a limitation of Windows Terminal, or if it's a Windows-specific problem in d-s-f. For now, I'm using e.g. |
The Perl equivalent would be:
What output do you get from that? Whatever we come up with, this is going to end up being some weird terminal problem. |
PowerShell may not understand the ' vs " (I'm not a PowerShell expert). Write those commands to a text file and then run perl.exe on that script. |
I'm at a loss... clearly diff-so-fancy is doing the right thing, it's just something with your terminal that's interpreting the UTF-8 characters incorrectly. |
I'm not sure it's UTF-8, necessarily. If I use My thought was perhaps that the escape sequence with Thanks for your effort! |
Definitely a weird issue. Let me know what you find. |
It seems like this issue is a limitation of perl-for-Windows. I had the thought to create a PowerShell-based version, which works nicely—except, perhaps unsurprisingly, less-for-Windows has the same problem, and there doesn't seem to be a suitable Windows-native alternative (you can pipe it through |
Does it work if you use cygwin / bash? |
Cygwin exhibits the same problem. I imagine that WSL would work, on account of having native Linux binaries instead of (old-ish) Windows versions. I was just hoping to have a more "native" solution. Anyways, it seems like this is solidly outside of d-s-f's control, so you may as well close the issue in my opinion. Perhaps you might mention in the README that Windows users without WSL might want to use git config --global color.diff-highlight.oldNormal "red bold"
- git config --global color.diff-highlight.oldHighlight "red bold 52"
+ git config --global color.diff-highlight.oldHighlight "red bold reverse"
git config --global color.diff-highlight.newNormal "green bold"
- git config --global color.diff-highlight.newHighlight "green bold 22"
+ git config --global color.diff-highlight.newHighlight "green bold reverse"
- git config --global color.diff.meta "11"
+ git config --global color.diff.meta "yellow bold" instead of the other settings. I also may yet continue my PowerShell effort, in hopes that a better pager might come along. Thanks again for your time! |
Glad we sort of got things resolved. |
Hi,
I encountered some problems using diff-so-fancy on windows with
Using this option the console produces the following output
instead of
The text was updated successfully, but these errors were encountered: