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 := 2

View on GitHub (pinned to d6c691947f)

Solutions

  1. Resize the terminal back to normal dimensions (>= 80x24) and continue.
  2. Run the TUI in a full-size terminal window or tmux pane with fixed size.
  3. Use --json/--ci mode in constrained environments instead of the interactive UI.
  4. If it reproduces at normal sizes, capture the wrapped error and report upstream.
Defensive patterns

Strategy: fallback

Prevention

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


AI-assisted analysis of wagoodman/dive@d6c691947f (2026-08-15). Data as JSON: /api/errors/4e0b7507c6c2adaf. Report an issue: GitHub.