delta icon indicating copy to clipboard operation
delta copied to clipboard

🐛 delta doesn't page in Windows Terminal

Open vikhik opened this issue 1 year ago • 3 comments

Discussed in https://github.com/dandavison/delta/discussions/1387

I'm getting the something similar to https://github.com/dandavison/delta/discussions/1387 on Windows 11/Powershell, even after using winget install -e jftuga.less.

But only with the common git lg alias: https://gist.github.com/johanmeiring/3002458

Repro:

  1. winget install -e jftuga.less
  2. winget install -e dandavison.delta
  3. git config --global core.pager delta
  4. git config --global interactive.diffFilter "delta --color-only"
  5. git config --global delta.navigate true
  6. git config --global merge.conflictStyle zdiff3
  7. restart shell, just in case
  8. git log --color --graph --abbrev-commit --oneline (works as expected)
  9. git lg (prints entire repo, no paging)

So it seems broken with --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'

vikhik avatar Nov 13 '24 13:11 vikhik

Actually - this appears to be more related to the terminal itself?

Doing git lg in the vscode terminal window works totally fine - but using either command in Windows Terminal is printing the whole log!

My bad - I was testing this on two different terminals and thinking it would be identical due to them both using Powershell.

Therfore... Delta doesn't work with Windows Terminal?

vikhik avatar Nov 13 '24 13:11 vikhik

Hi @vikhik, I'm guessing the problem is that in your Windows Terminal, delta is not finding an executable named "less"? You could investigate by using delta's --pager flag to specify an absolute path to less (all delta flags can be set in git config also, so that would be something like git config --global delta.pager AbsolutePathToLess.

dandavison avatar Nov 13 '24 15:11 dandavison

So, for what it's worth, less does correctly run: image

I checked where less.exe is, and ran git config --global delta.pager "C:\Program Files\Git\usr\bin\less.exe" - but I still have the same issue.

vikhik avatar Dec 05 '24 12:12 vikhik