mistakenelf / fm

A terminal based file manager
MIT License
572 stars 29 forks source link

Crash while trying to navigate $HOME #115

Open TypicalAM opened 1 week ago

TypicalAM commented 1 week ago

Upstream fm crashes when running the app in $HOME. Steps to reproduce:

Additional info:

Caught panic:

runtime error: index out of range [0] with length 0

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /usr/lib/golang/src/runtime/debug/stack.go:24 +0x5e
runtime/debug.PrintStack()
        /usr/lib/golang/src/runtime/debug/stack.go:16 +0x13
github.com/charmbracelet/bubbletea.(*Program).Run.func1()
        /home/adam/.go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:478 +0x91
panic({0x9459c0?, 0xc000154b28?})
        /usr/lib/golang/src/runtime/panic.go:770 +0x132
github.com/mistakenelf/fm/filetree.Model.Update({{0x0, 0x0, 0x0}, 0x0, 0x0, 0x1b, 0x1c, 0x38, 0x0, 0x1, ...}, ...)
        /home/adam/.go/pkg/mod/github.com/mistakenelf/fm@v1.1.0/filetree/update.go:176 +0x68f2
github.com/mistakenelf/fm/internal/tui.model.Update({{{0x0, 0x0, 0x0}, 0x0, 0x0, 0x1b, 0x1c, 0x38, 0x0, 0x1, ...}, ...}, ...)
        /home/adam/.go/pkg/mod/github.com/mistakenelf/fm@v1.1.0/internal/tui/update.go:177 +0x999
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc0002a6c30, {0xcc3958?, 0xc0000cd508?}, 0xc0001173e0)
        /home/adam/.go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:411 +0x5e2
github.com/charmbracelet/bubbletea.(*Program).Run(0xc0002a6c30)
        /home/adam/.go/pkg/mod/github.com/charmbracelet/bubbletea@v0.25.0/tea.go:543 +0x86b
github.com/mistakenelf/fm/cmd.init.func1(0x100cd20, {0x108c5c0?, 0x7?, 0x96f176?})
        /home/adam/.go/pkg/mod/github.com/mistakenelf/fm@v1.1.0/cmd/root.go:88 +0x8a5
github.com/spf13/cobra.(*Command).execute(0x100cd20, {0xc00010e060, 0x0, 0x0})
        /home/adam/.go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0xab1
github.com/spf13/cobra.(*Command).ExecuteC(0x100cd20)
        /home/adam/.go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/adam/.go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/mistakenelf/fm/cmd.Execute()
        /home/adam/.go/pkg/mod/github.com/mistakenelf/fm@v1.1.0/cmd/root.go:107 +0x211
main.main()
        /home/adam/.go/pkg/mod/github.com/mistakenelf/fm@v1.1.0/main.go:6 +0xf
TypicalAM commented 1 week ago

May be related to yorukot/superfile#486 and having a file where we can't read the size