delta: UTF-8 problems on Windows
I’m finding that either delta or my terminal emulator is having a hard time with the non-ascii characters used for decorations. Long lines also don’t quite behave ideally. While I think delta is somehow the problem here, I’m not really sure, but I figured it would be good to at least file an issue in case anyone else encounters a similar problem. Even if I’m wrong, if someone could point me in the right direction, I’d appreciate it.
Assorted pertinent information:
- Running in the latest version of MSYS2 mintty on Windows 8.1
- I am using the version of less that comes with MSYS2; unsure if that is the same as what git-for-windows ships with.
- I installed both delta and bat via cargo, and neither are aliased.
- My bat config file contains only custom --map-syntax flags

Regardless of the value of core.pager:

Raw git diff for an arbitrary git-managed file:
(for now, only the first few lines of it, because that’s really all I expect will be needed and the whole thing is just over 200 lines)
Without any value set for core.pager:

Side note regarding the width
I know that the issue with the width can be handled with git diff .inputrc | delta -ns --width="$(tput cols)", but that still doesn’t provide any means of displaying parts of a line that continue off screen.
The complete text of line 49 reads # If enabled, lists all matches in case multiple possible completions are possible.. Please just disregard how odd “possible completions are possible” sounds.
After git config --global core.pager=delta, the first few lines of git diff .inputrc are shown as:
and just for good measure, after adding to my global gitconfig
[delta]
features = side-by-side line-numbers
syntax-theme = Monokai Extended
[delta "line-numbers"]
line-numbers = true
[interactive]
diffFilter = delta --color-only
It only gets worse
and either way, there’s still that little detail regarding the parts of the line that aren’t initially shown.
Oh yeah, as I was getting screenshots and writing out this issue report, I discovered that trying to pipe either git diff .inputrc | delta or git diff .inputrc(with the previously mentioned gitconfig settings applied) through programs like head or tail only seems to pass along the default git diff output; not sure if that’s supposed to happen.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (12 by maintainers)
I’m hoping that the
DELTA_PAGERfix does work and thatdelta a bwill work withdiffpresent!Tangentially – you might be interested in #197 which discusses Chocolatey and
lesson Windows.I’m thinking this is because there are two versions of less on your system. When git runs, I think it ensures that its own less has precedence in child processes, and thus delta picks up the good less in that context. So, can you locate the good less (perhaps something like
C:\Program Files\Git\usr\bin\less.exe? according to this) and make delta use that (e.g. by setting theDELTA_PAGERenv var to that absolute path)?