wagoodman/dive · error
unable to setup layer controller onLayoutChange: %w
Error message
unable to setup layer controller onLayoutChange: %w
What it means
TUI layout error from the LayerDetailsCompoundLayout: during OnLayoutChange (invoked when screen dimensions change) the layer view's OnLayoutChange() failed and is wrapped with this message. It is the first of three sequential child-layout propagations (layer, layerDetails, imageDetails).
Source
Thrown at cmd/dive/cli/internal/ui/v1/layout/compound/layer_details_column.go:34
}
func NewLayerDetailsCompoundLayout(layer *view.Layer, layerDetails *view.LayerDetails, imageDetails *view.ImageDetails) *LayerDetailsCompoundLayout {
return &LayerDetailsCompoundLayout{
layer: layer,
layerDetails: layerDetails,
imageDetails: imageDetails,
}
}
func (cl *LayerDetailsCompoundLayout) Name() string {
return "layer-details-compound-column"
}
// OnLayoutChange is called whenever the screen dimensions are changed
func (cl *LayerDetailsCompoundLayout) OnLayoutChange() error {
err := cl.layer.OnLayoutChange()
if err != nil {
return fmt.Errorf("unable to setup layer controller onLayoutChange: %w", err)
}
err = cl.layerDetails.OnLayoutChange()
if err != nil {
return fmt.Errorf("unable to setup layer details controller onLayoutChange: %w", err)
}
err = cl.imageDetails.OnLayoutChange()
if err != nil {
return fmt.Errorf("unable to setup image details controller onLayoutChange: %w", err)
}
return nil
}
func (cl *LayerDetailsCompoundLayout) layoutRow(g *gocui.Gui, minX, minY, maxX, maxY int, viewName string, setup func(*gocui.View, *gocui.View) error) error {
log.WithFields("ui", cl.Name()).Tracef("layoutRow(g, minX: %d, minY: %d, maxX: %d, maxY: %d, viewName: %s, <setup func>)", minX, minY, maxX, maxY, viewName)
// header + border
headerHeight := 2View on GitHub (pinned to d6c691947f)
Solutions
- Resize the terminal back to normal dimensions (>= 80x24) and continue.
- Run the TUI in a full-size terminal window or tmux pane with fixed size.
- Use --json/--ci mode in constrained environments instead of the interactive UI.
- If it reproduces at normal sizes, capture the wrapped error and report upstream.
Defensive patterns
Strategy: fallback
Prevention
- Run the TUI at stable, adequate terminal sizes.
- Use --json in constrained or headless environments.
- Report resize-triggered layout errors upstream with terminal emulator details.
When it happens
Trigger: A terminal resize event triggering the layer view's relayout, which fails — typically because the recomputed dimensions are degenerate (zero height/width) or the underlying gocui view operations error during relayout.
Common situations: Resizing the terminal to a very small size; running the TUI in a terminal pane without adequate rows; resize events delivered during startup.
Related errors
- unable to setup layer details controller onLayoutChange: %w
- unable to setup image details controller onLayoutChange: %w
- unable to setup row layout for %s: %w
- controller failed update: %w
- controller failed render: %w
AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15).
Data as JSON: /api/errors/4e0b7507c6c2adaf.
Report an issue: GitHub.