wagoodman/dive · error
controller unable to switch to next pane: %w
Error message
controller unable to switch to next pane: %w
What it means
TUI controller error wrapping a failure of gocui's SetCurrentView() during NextPane() focus cycling (Layer -> LayerDetails -> ImageDetails -> Layer). SetCurrentView errors when the target view name does not exist or is not yet managed by the gui.
Source
Thrown at cmd/dive/cli/internal/ui/v1/app/controller.go:171
//nolint:dupl
func (c *controller) NextPane() (err error) {
v := c.gui.CurrentView()
if v == nil {
panic("CurrentView is nil")
}
if v.Name() == c.views.Layer.Name() {
_, err = c.gui.SetCurrentView(c.views.LayerDetails.Name())
c.views.Status.SetCurrentView(c.views.LayerDetails)
} else if v.Name() == c.views.LayerDetails.Name() {
_, err = c.gui.SetCurrentView(c.views.ImageDetails.Name())
c.views.Status.SetCurrentView(c.views.ImageDetails)
} else if v.Name() == c.views.ImageDetails.Name() {
_, err = c.gui.SetCurrentView(c.views.Layer.Name())
c.views.Status.SetCurrentView(c.views.Layer)
}
if err != nil {
return fmt.Errorf("controller unable to switch to next pane: %w", err)
}
return c.UpdateAndRender()
}
//nolint:dupl
func (c *controller) PrevPane() (err error) {
v := c.gui.CurrentView()
if v == nil {
panic("Current view is nil")
}
if v.Name() == c.views.Layer.Name() {
_, err = c.gui.SetCurrentView(c.views.ImageDetails.Name())
c.views.Status.SetCurrentView(c.views.ImageDetails)
} else if v.Name() == c.views.LayerDetails.Name() {
_, err = c.gui.SetCurrentView(c.views.Layer.Name())
c.views.Status.SetCurrentView(c.views.Layer)
} else if v.Name() == c.views.ImageDetails.Name() {View on GitHub (pinned to d6c691947f)
Solutions
- Wait for the UI to fully draw before pressing pane-switch keys.
- Avoid resizing the terminal to degenerate sizes while the TUI is open.
- Update to the latest dive; pane initialization ordering has been hardened across releases.
- If it persists, capture the wrapped gocui error and file an upstream issue with terminal info.
Defensive patterns
Strategy: fallback
Prevention
- Wait for the initial layout to finish before pressing pane-switch keys.
- Avoid extreme terminal resizes while the TUI runs.
- Reproduce and report startup-race pane errors upstream.
When it happens
Trigger: Pressing the next-pane keybinding before the initial layout has registered all three views, or after a layout change dropped a view; can also fire if view names get out of sync with what gocui has created.
Common situations: Rapid keypresses during application startup; extreme terminal resizes tearing down views; custom builds where a view was renamed but the pane-cycle code was not updated.
Related errors
- controller unable to switch to previous pane: %w
- controller unable to toggle view: %w
- unable to toggle filter view (back): %w
- controller failed update: %w
- controller failed render: %w
AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15).
Data as JSON: /api/errors/6d863b2c68366eca.
Report an issue: GitHub.