jesseduffield/lazygit · error

gui.sidePanels must not be empty.

Error message

gui.sidePanels must not be empty.

What it means

Validation error from validateSidePanels (user_config_validation.go:87). After iterating all panels, if no tab was counted at all (total == 0) then gui.sidePanels is an empty list of panels — there would be nothing to show in the side panels region. lazygit rejects this at startup rather than render an empty UI.

Source

Thrown at pkg/config/user_config_validation.go:87

	total := 0
	for _, panel := range panels {
		if len(panel) == 0 {
			return errors.New("gui.sidePanels: a side panel must have at least one tab.")
		}
		for _, name := range panel {
			if !slices.Contains(ValidSidePanelTabs, name) {
				return fmt.Errorf("gui.sidePanels: unknown side panel '%s'. Allowed values: %s",
					name, strings.Join(ValidSidePanelTabs, ", "))
			}
			if seen[name] {
				return fmt.Errorf("gui.sidePanels: '%s' is listed more than once; each side panel may appear only once.", name)
			}
			seen[name] = true
			total++
		}
	}
	if total == 0 {
		return errors.New("gui.sidePanels must not be empty.")
	}
	// A lot of code focuses these panels directly (e.g. after resolving a
	// conflict or popping a stash), so they must always be present; otherwise
	// that code would focus a hidden panel.
	for _, required := range []string{"files", "branches", "commits"} {
		if !seen[required] {
			return fmt.Errorf("gui.sidePanels: '%s' must be included; it can't be hidden.", required)
		}
	}
	return nil
}

func validateSpinner(spinner SpinnerConfig) error {
	if len(spinner.Frames) == 0 {
		return errors.New("gui.spinner.frames must not be empty.")
	}
	firstWidth := utils.StringWidth(spinner.Frames[0])
	if lo.SomeBy(spinner.Frames, func(frame string) bool {

View on GitHub (pinned to c477a2959b)

Solutions

  1. Populate sidePanels with at least one panel containing at least one tab, e.g. '- [commits]'
  2. Ensure the required tabs files, branches, commits are present across all panels (the validator enforces this next)
  3. If the goal was fewer panels, merge tabs into fewer panels instead of emptying the list

Example fix

# before
gui:
  sidePanels: []

# after
gui:
  sidePanels:
    - [files, branches, commits]
Defensive patterns

Strategy: validation

Validate before calling

function hasAtLeastOnePanel(panels [][]string) bool { return len(panels) > 0 }

Prevention

When it happens

Trigger: Setting 'gui: sidePanels: []' (empty top-level list) in config.yml. Note this is the outer list being empty; an empty inner list is the separate 'at least one tab' error.

Common situations: Attempting to hide all side panels for a commits-only workflow; YAML 'sidePanels:' with nothing beneath it parsing as an empty list; config templating that emits an empty array.

Related errors


AI-assisted analysis of jesseduffield/lazygit@c477a2959b (2026-08-15). Data as JSON: /api/errors/9f2884b8fd839a6d. Report an issue: GitHub.