wagoodman/dive · warning
unable to setup debug controller: %w
Error message
unable to setup debug controller: %w
What it means
Raised in the debug footer view's Layout when Debug.Setup fails on first-time view creation (utils.IsNewView true). Setup assigns view options and calls Render(); in the current code Render always returns nil, so this wrap only triggers if Setup is extended or panics are converted to errors. It is effectively a defensive wrapper around future/debug setup logic.
Source
Thrown at cmd/dive/cli/internal/ui/v1/view/debug.go:116
return nil
})
return nil
}
func (v *Debug) Layout(g *gocui.Gui, minX, minY, maxX, maxY int) error {
v.logger.Tracef("layout(minX: %d, minY: %d, maxX: %d, maxY: %d)", minX, minY, maxX, maxY)
// header
headerSize := 1
// note: maxY needs to account for the (invisible) border, thus a +1
header, headerErr := g.SetView(v.Name()+"header", minX, minY, maxX, minY+headerSize+1, 0)
// we are going to overlap the view over the (invisible) border (so minY will be one less than expected).
// additionally, maxY will be bumped by one to include the border
view, viewErr := g.SetView(v.Name(), minX, minY+headerSize, maxX, maxY+1, 0)
if utils.IsNewView(viewErr, headerErr) {
err := v.Setup(view, header)
if err != nil {
return fmt.Errorf("unable to setup debug controller: %w", err)
}
}
return nil
}
func (v *Debug) RequestedSize(available int) *int {
return nil
}
View on GitHub (pinned to d6c691947f)
Solutions
- If running a fork, check what Debug.Setup does in your build — stock dive cannot produce this error
- Verify the debug view geometry is sane (maxY+1 > minY) on tiny terminals
- If you see it in stock dive, report it upstream with the wrapped error text
- Ensure the terminal is a real TTY with adequate size
Defensive patterns
Strategy: try-catch
Try / catch
if err := v.Setup(view, header); err != nil {
return fmt.Errorf("unable to setup debug controller: %w", err)
} Prevention
- In forks, keep Debug.Setup side-effect free or return nil for cosmetic failures
- Verify debug view geometry on small terminals
When it happens
Trigger: g.SetView succeeding for 'debug'/'debugheader' but Debug.Setup(view, header) returning non-nil. Today Setup only sets Editable/Wrap/Frame and calls Render (which returns nil), so the error path requires a code change or a write failure surfacing from Render in a modified build.
Common situations: Custom forks that add keybindings or writes to the debug view during Setup; running a modified dive build where Debug.Render can fail; extremely small terminals where the header view is degenerate.
Related errors
- unable to setup status controller: %w
- unable to move the cursor, empty line
- failed to set UI: %w
- failed to set UI: %w
- unable to layout %q: %w
AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15).
Data as JSON: /api/errors/ed78c71b8d6eef6e.
Report an issue: GitHub.