lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Crash when I scroll to an unstaged file in the staging menu

Open Nikola-Milovic opened this issue 2 years ago • 8 comments

Describe the bug I've merged a branch into my current working branch, I got a ton of files, there were some GraphQL generated schema issues and I reran the generator. So I ended up with 100+ stages files and 2 unstaged newly generated schemas. When I scroll to the schemas to actually check them out and verify everything is okay as soon as I get to the unstaged files I immediately crash.

To Reproduce

*errors.errorString exec: Stdout already set
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/utils/errors.go:13 (0x8fbf45)
	sanitisedCommandOutput: return errors.Wrap(err, 0)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/commands/oscommands/cmd_obj_runner.go:135 (0x8fbefe)
	sanitisedCommandOutput: return "", utils.WrapError(err)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/commands/oscommands/cmd_obj_runner.go:60 (0x8fb94a)
	(*cmdObjRunner).RunWithOutput: output, err := sanitisedCommandOutput(cmdObj.GetCmd().CombinedOutput())
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/commands/git_cmd_obj_runner.go:30 (0x93b905)
	(*gitCmdObjRunner).RunWithOutput: output, err := self.innerRunner.RunWithOutput(cmdObj)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/commands/git_cmd_obj_runner.go:19 (0x93b865)
	(*gitCmdObjRunner).Run: _, err := self.RunWithOutput(cmdObj)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/commands/oscommands/cmd_obj.go:102 (0x8faa6f)
	(*CmdObj).Run: return self.runner.Run(self)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/commands/git_commands/working_tree.go:59 (0x9372ad)
	(*WorkingTreeCommands).StageFile: return self.cmd.New("git add -- " + self.cmd.Quote(fileName)).Run()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/files_panel.go:159 (0x97be2b)
	(*Gui).stageSelectedFile: return gui.Git.WorkingTree.StageFile(file.Name)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/merge_panel.go:260 (0x9af085)
	(*Gui).handleCompleteMerge: if err := gui.stageSelectedFile(); err != nil {
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/merge_panel.go:178 (0x9ae725)
	(*Gui).renderConflicts: return false, gui.handleCompleteMerge()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/merge_panel.go:159 (0x9ae474)
	(*Gui).renderConflictsFromFilesPanel: _, err := gui.renderConflicts(state, false)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/files_panel.go:57 (0x97b618)
	(*Gui).filesRenderToMain: return gui.renderConflictsFromFilesPanel()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/context_config.go:216 (0x9a711b)
	(*Gui).filesListContext.func6: return f()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/list_context.go:153 (0x9a5f59)
	(*ListContext).HandleFocus: if err := self.OnRenderToMain(opts...); err != nil {
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/list_context.go:209 (0x9a6545)
	(*ListContext).handleLineChange: return self.HandleFocus()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/list_context.go:166 (0x9a605e)
	(*ListContext).handleNextLine: return self.handleLineChange(1)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/confirmation_panel.go:317 (0x9a247b)
	(*Gui).keybindings.func2: return f()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/gui.go:1166 (0x8e11d9)
	(*Gui).execKeybinding: if err := kb.handler(g, v); err != nil {
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/gui.go:1134 (0x8e0f30)
	(*Gui).execKeybindings: return g.execKeybinding(v, kb)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/gui.go:1059 (0x8e077e)
	(*Gui).onKey: _, err := g.execKeybindings(g.currentView, ev)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/gui.go:650 (0x8def85)
	(*Gui).handleEvent: return g.onKey(ev)
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/gui.go:610 (0x8debc5)
	(*Gui).MainLoop: if err := g.handleEvent(&ev); err != nil {
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/gui.go:565 (0x988d1a)
	(*Gui).Run: err = g.MainLoop()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/gui.go:573 (0x989054)
	(*Gui).RunAndHandleError.func1: if err := gui.Run(); err != nil {
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/utils/utils.go:106 (0x8ec867)
	SafeWithError: err := f()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/gui/gui.go:572 (0x988fe7)
	(*Gui).RunAndHandleError: return utils.SafeWithError(func() error {
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/pkg/app/app.go:248 (0x9d5945)
	(*App).Run: err := app.Gui.RunAndHandleError()
/home/nikola/go/pkg/mod/github.com/jesseduffield/[email protected]/main.go:138 (0x9d701d)
	main: err = app.Run()
/usr/local/go/src/runtime/proc.go:250 (0x437f32)
	main: fn()
/usr/local/go/src/runtime/asm_amd64.s:1571 (0x465801)
	goexit: BYTE	$0x90	// NOP

Expected behavior Keep scrolling and not crash.

Desktop (please complete the following information):

lazygit -v
commit=, build date=, build source=unknown, version=unversioned, os=linux, arch=amd64

Installed through go I believe and the version is v0.32.2

  • OS:Ubuntu 20.04

Screenshots As you can see from the video, I can scroll normally, but when I actually get to these files if I try to scroll downwards I crash

https://user-images.githubusercontent.com/50072027/178670232-ab5bdcfc-6da7-4a2b-b30d-ac525ff59379.mp4

Nikola-Milovic avatar Jul 13 '22 06:07 Nikola-Milovic

That version is quite dated, could you please try building current master?

mark2185 avatar Jul 13 '22 07:07 mark2185

@mark2185 I'll try with the newest version but I already used the CLI to finish the work. I'll see with the next occurrence and close this if necessary

Nikola-Milovic avatar Jul 13 '22 09:07 Nikola-Milovic

@mark2185 do you have any extra options for git paging in your config.yml? If yes try to disable them.

zoer avatar Jul 27 '22 11:07 zoer

@mark2185 do you have any extra options for git paging in your config.yml? If yes try to disable them.

I assume that was intended for @Nikola-Milovic ?

mark2185 avatar Jul 27 '22 12:07 mark2185

@mark2185 yes, sorry :)

zoer avatar Jul 27 '22 12:07 zoer

@Nikola-Milovic do you use the delta pager by any change? Related

mark2185 avatar Jul 29 '22 06:07 mark2185

@mark2185 yeah

git:
  paging:
    colorArg: never
    pager: delta --dark --paging=never

Nikola-Milovic avatar Jul 29 '22 07:07 Nikola-Milovic