Skip to content

Panic when iterating through list view #2814

@jesseduffield

Description

@jesseduffield

Describe the bug

Stack trace:

panic: runtime error: index out of range [2276] with length 2276

goroutine 7997 [running]:
bytes.Runes({0xc0010dd493, 0xa58, 0xb6d})
	/Users/jesseduffieldduffield/.gvm/gos/go1.18/src/bytes/bytes.go:1063 +0xfe
github.com/jesseduffield/gocui.(*View).Write(0xc000001c20, {0xc0010dd493?, 0xa58, 0x0?})
	/Users/jesseduffieldduffield/repos/lazygit/vendor/github.com/jesseduffield/gocui/view.go:642 +0xd3
github.com/jesseduffield/lazygit/pkg/tasks.(*ViewBufferManager).NewCmdTask.func1.6.1(...)
	/Users/jesseduffieldduffield/repos/lazygit/pkg/tasks/tasks.go:204
github.com/jesseduffield/lazygit/pkg/tasks.(*ViewBufferManager).NewCmdTask.func1.6()
	/Users/jesseduffieldduffield/repos/lazygit/pkg/tasks/tasks.go:246 +0x523
github.com/jesseduffield/lazygit/pkg/utils.Safe.func1()
	/Users/jesseduffieldduffield/repos/lazygit/pkg/utils/utils.go:108 +0x1b
github.com/jesseduffield/lazygit/pkg/utils.SafeWithError(0x103e2a5?)
	/Users/jesseduffieldduffield/repos/lazygit/pkg/utils/utils.go:119 +0x67
github.com/jesseduffield/lazygit/pkg/utils.Safe(0x100000002?)
	/Users/jesseduffieldduffield/repos/lazygit/pkg/utils/utils.go:108 +0x35
created by github.com/jesseduffield/lazygit/pkg/tasks.(*ViewBufferManager).NewCmdTask.func1
	/Users/jesseduffieldduffield/repos/lazygit/pkg/tasks/tasks.go:200 +0x83c
exit status 2

To Reproduce
Open lazygit and start iterating through list items

Expected behavior
No Panic

Version info:
commit=, build date=, build source=unknown, version=unversioned, os=darwin, arch=amd64, git version=2.41.0
happens on v0.39.2

Additional context
Extra context in #2813

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions