Still seeing errors when using delta
Describe the bug I get panics when using delta as a pager.
Specifically ones like this one:
panic: runtime error: index out of range [3] with length 3
goroutine 198 [running]:
github.com/jesseduffield/gocui.(*escapeInterpreter).outputTrue(0xc000232640)
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/vendor/github.com/jesseduffield/gocui/escape.go:304 +0x430
github.com/jesseduffield/gocui.(*escapeInterpreter).parseOne(0xc000232640, 0x34)
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/vendor/github.com/jesseduffield/gocui/escape.go:166 +0x428
github.com/jesseduffield/gocui.(*View).parseInput(0xc000246b40, 0x6d)
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/vendor/github.com/jesseduffield/gocui/view.go:667 +0x45
github.com/jesseduffield/gocui.(*View).writeRunes(0xc000246b40, {0xc000562000, 0x7d, 0x38})
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/vendor/github.com/jesseduffield/gocui/view.go:638 +0x15a
github.com/jesseduffield/gocui.(*View).Write(0xc000246b40, {0xc0002a8437, 0x7d, 0x0})
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/vendor/github.com/jesseduffield/gocui/view.go:606 +0xe6
github.com/jesseduffield/lazygit/pkg/tasks.(*ViewBufferManager).NewCmdTask.func1.4()
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/pkg/tasks/tasks.go:182 +0x24b
github.com/jesseduffield/lazygit/pkg/utils.Safe.func1()
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/pkg/utils/utils.go:95 +0x1b
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0x43e9c5)
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/pkg/utils/utils.go:106 +0x67
github.com/jesseduffield/lazygit/pkg/utils.Safe(0x0)
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/pkg/utils/utils.go:95 +0x35
created by github.com/jesseduffield/lazygit/pkg/tasks.(*ViewBufferManager).NewCmdTask.func1
/home/me/.cache/yay/lazygit-git/src/src/github.com/jesseduffield/lazygit/pkg/tasks/tasks.go:151 +0x645
To Reproduce I am not entirely sure how to reproduce. It mostly happens when seeing diffs for commits, less so when staging changes. My configs look like this:
lazygit:
git:
pull:
mode: 'auto'
overrideGpg: true
paging:
colorArg: always
pager: delta --dark --paging=never
services:
'git.rtx.mapspeople.com': 'gitlab:git.rtx.mapspeople.com'
And git:
[user]
name = Mikael Elkiaer
email = [email protected]
[includeIf "gitdir:**/Repositories/GitHub/**"]
path = ~/.gitconfig-github
[includeIf "gitdir:**/Repositories/MapsPeople/**"]
path = ~/.gitconfig-mapspeople
[includeIf "gitdir:**/Repositories/AUR/**"]
path = ~/.gitconfig-aur
[core]
autocrlf = input
editor = nvim
pager = delta --dark
[interactive]
diffFilter = delta --dark --color-only
[rebase]
autosquash = true
[credential]
helper = cache
[pull]
rebase = true
[merge]
ff = false
tool = vimdiff
[push]
default = current
[alias]
{...}
[color]
ui = auto
[diff]
tool = vimdiff
[advice]
addIgnoredFile = false
Expected behavior Expected it to work, as it had done previously.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
lazygit -voutputscommit=d0196263, build date=20220117.112305, build source=unknown, version=v0.32.1.d0196263, os=linux, arch=amd64- Running on Manjaro i3 edition
Additional context Add any other context about the problem here.
Can't reproduce myself (though I don't typically use delta locally). looking at the code from that stack trace, I'm not sure if we're failing to handle an escape sequence that's got fewer than 5 elements, or if we've got a race condition where we're swapping out one sequence for another, but I suspect it's the former.
I'll dig a little deeper, as I finally have a proper dev set-up, thanks to the PR I did.
I was just hoping it might ring a bell for you, seeing the previous issues with delta. :)
Sounds good, lemme know if you need any guidance :)
It seems to consistently crash trying to diff on the same file for me, if that helps:

The second I try to see the diff of that file it crashes.
Before:

After:

@iovis I haven't taken time to look at this, and not sure if I ever will. I just went back to the default pager for lazygit.
No problem, I understand. Thanks for the heads up!
Related: https://github.com/jesseduffield/lazygit/issues/1311#issuecomment-1198662097
Seems related to the 24-bit color option?
git:
paging:
colorArg: always
pager: delta --dark --paging=never --true-color=never
Seems to work
Seems related to the 24-bit color option?
git: paging: colorArg: always pager: delta --dark --paging=never --true-color=neverSeems to work
I will try this out.
Seems related to the 24-bit color option?
git: paging: colorArg: always pager: delta --dark --paging=never --true-color=neverSeems to work
--true-color=never does indeed seem to get rid of the errors. Unfortunately, at least with my colors, it gets harder to read the diffs.
Unfortunately, at least with my colors, it gets harder to read the diffs.
Yeah, with mine too, but I figured it could help find the root cause of the incompatibility