Skip to content

Segfault on small terminal pane #77

@nicholasdille

Description

@nicholasdille

When I have a small terminal pane (like 17 lines), the following happends:

When I have one large cluster expanded and I move the cursor down to expand another cluster I get a segfault:

Caught panic:

runtime error: slice bounds out of range [138:46]

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.26.2/x64/src/runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
        /opt/hostedtoolcache/go/1.26.2/x64/src/runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0x11366f27e280, {0x128de60, 0x11366f5b75c0})
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.10/tea.go:847 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.10/tea.go:638 +0x10c
panic({0x128de60?, 0x11366f5b75c0?})
        /opt/hostedtoolcache/go/1.26.2/x64/src/runtime/panic.go:860 +0x13a
main.model.View({{0x11366f300400, 0x7, 0x8}, 0x97, 0x0, {0x11366f486b7b, 0x5}, {0x11366f486ad0, 0xb}, 0x11, ...})
        /home/runner/work/kubeswitch/kubeswitch/main.go:443 +0x1829
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0x11366f27e280, {0x1435f60?, 0x11366f294070?}, 0x11366f3f8230)
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.10/tea.go:502 +0x889
github.com/charmbracelet/bubbletea.(*Program).Run(0x11366f27e280)
        /home/runner/go/pkg/mod/github.com/charmbracelet/bubbletea@v1.3.10/tea.go:716 +0xae7
main.main()
        /home/runner/work/kubeswitch/kubeswitch/main.go:543 +0x80c
2026/04/30 13:59:16 program was killed: program experienced a panic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions