lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

[Windows] git diff is not shown using delta as pager in lazygit, but works fine in command line in terminal

Open hopezh opened this issue 3 years ago • 4 comments

Describe the bug As shown below, I can see the diff of a local git repo using git diff with delta as the pager in the terminal.

However, lazygit doesn't show this diff in the "delta way" although I have specified delta as its pager.

My .gitconfig and config.yml for lazygit are shown below.

Strangely, the same configuration works fine in Mac OS with git diff highlighted with delta in both command-line and lazygit...

May I ask what important steps I may have missed here?

Thanks.

To Reproduce (As described above)

Expected behavior (As described above)

Screenshots running git diff in command-line: 2022-12-28-15-13-49

git diff as shown in lazygit: 2022-12-28-15-10-31

My git config file ~/.gitconfig

[user]
	name = USER
	email = [email protected]
[core]
	pager = delta
[interactive]
    diffFilter = delta --color-only --features=interactive
[delta]
    navigate = true    
    light = false      
    side-by-side = true  
    line-numbers = true   
    features = decorations	 
[delta "interactive"]
    keep-plus-minus-markers = true
[delta "decorations"]
    commit-decoration-style = blue ol
    commit-style = raw
    file-style = omit
    hunk-header-decoration-style = blue box
    hunk-header-file-style = red
    hunk-header-line-number-style = "#067a00"
    hunk-header-style = file line-number syntax
[merge]
    conflictstyle = diff3
[diff]
    colorMoved = default

My lazygit config file ~/AppData/Roaming/lazygit/config.yml (I was directed to ~/AppData/Roaming when I pasted %APPDATA% in File Explorer.)

git:
  paging:
    colorArg: never
    pager: delta --dark --paging=never 
    # pager: ydiff -p cat -s --wrap --width={{columnWidth}}   
    useConfig: false

Version info: Run lazygit --version and paste the result here: commit=d1a8b05401ccda1e52215203139a252eb3be3b79, build date=2022-11-14T09:22:31Z, build source=binaryRelease, version=0.36.0, os=windows, arch=amd64, git version=2.34.1.windows.1

Run git --version and paste the result here git version 2.34.1.windows.1

Additional context OS: Windows 11 Pro, 64bit, 22H2, build 22621.963

Reference read #2300

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

hopezh avatar Dec 29 '22 04:12 hopezh

Same probelm here, in the docs its written that custom pagers are not supported on Windows, however I think it would be quite usefull since delta allows quite a boost in productivity.

aropele avatar Jan 03 '23 08:01 aropele

duplicated of https://github.com/jesseduffield/lazygit/issues/1453

Ryooooooga avatar Jan 04 '23 12:01 Ryooooooga

I'm begging for a solution to this one. I don't think I can use Lazygit if I can't get it to display side-by-side diffs. Has anyone successfully configured Lazygit to do this?

mvolkmann avatar Apr 11 '23 01:04 mvolkmann

Having same issue :(

hasansujon786 avatar Apr 15 '23 11:04 hasansujon786

I FINALLY got side-by-side diffs to work! See my writeup at https://mvolkmann.github.io/blog/topics/#/blog/neovim/. Click "16. Lazygit" in the table of contents at the top. My instructions are specific to macOS.

mvolkmann avatar May 10 '23 01:05 mvolkmann

I FINALLY got side-by-side diffs to work! See my writeup at https://mvolkmann.github.io/blog/topics/#/blog/neovim/. Click "16. Lazygit" in the table of contents at the top. My instructions are specific to macOS.

Thanks. Unfortunately, the issue I reported, and echoed by others, are for Windows system, specifically... There's no solution, so far, as it seems...

hopezh avatar May 10 '23 05:05 hopezh

My same config works on linux but not windows too. In linux or wsl, I can utilize delta as git parser perfectly.

charliie-dev avatar May 18 '23 08:05 charliie-dev

I also have the same issue, running delta and lazygit on Windows 10 x64. Any bugfix @jesseduffield ?

pidgeon777 avatar May 22 '23 19:05 pidgeon777

Same here. Using delta as custom pager works as intended in the terminal but does not when using/invoking a lazygit instance.

Using Windows 10 x64 as well.

adrivn avatar Jun 07 '23 09:06 adrivn

Closing as a duplicate of https://github.com/jesseduffield/lazygit/pull/2715

Believe me, I want windows to work just as well as osx/linux but we have a dependency with a windows-compatibility PR that's stuck in limbo so there's not much we can do until that's merged

jesseduffield avatar Jun 07 '23 22:06 jesseduffield

Understood. This is not a critical issue. I'm learning and enjoying lazygit everyday. Thank you very much.

hopezh avatar Jun 08 '23 02:06 hopezh