junegunn/fzf · warning

too large (max: %%)

Error message

%s too large (max: %d%%)

What it means

A size option given as a percentage exceeded the allowed maximum for that option. parseSize caps percent-form values (e.g. 100 for --height, smaller caps for other size options), and this error reports which label (height, preview size, margin, etc.) overshot and by what cap.

Solutions

  1. Lower the percentage to at or below the cap shown in the message (e.g. --height=100% is the max)
  2. If you want more room, switch to the lines form which has no percent cap: --height=40 (or --height=~40% for auto)
  3. Validate computed values before invoking fzf in your script

Example fix

# before
fzf --height=150%
# after
fzf --height=100%
# or use lines
fzf --height=40
Defensive patterns

Strategy: validation

Validate before calling

# clamp computed percentage before invoking fzf
pct=$(( lines * 100 / total ))
[ "$pct" -gt 100 ] && pct=100
fzf --height="${pct}%"

Prevention

When it happens

Trigger: Passing e.g. --height=150% (max 100), or a --preview-window size / margin value above its percent cap; any parseSize call where the numeric value before '%' is greater than the maxPercent argument.

Common situations: Scripts computing heights dynamically (N% based on terminal lines) and forgetting the percent-mode cap; copy-paste of a size meant for a different option; confusion between lines and percent forms.

Related errors


AI-assisted analysis of junegunn/fzf@bd4efa277b (2026-08-15). Data as JSON: /api/errors/69ed9a29ed71d9d0. Report an issue: GitHub.

Appendix: source

Thrown at src/options.go:2239

func strLines(str string) []string {
	return strings.Split(strings.TrimSuffix(str, "\n"), "\n")
}

func parseSize(str string, maxPercent float64, label string) (sizeSpec, error) {
	var spec = sizeSpec{}
	var val float64
	var err error
	percent := strings.HasSuffix(str, "%")
	if percent {
		if val, err = atof(str[:len(str)-1]); err != nil {
			return spec, err
		}

		if val < 0 {
			return spec, errors.New(label + " must be non-negative")
		}
		if val > maxPercent {
			return spec, fmt.Errorf("%s too large (max: %d%%)", label, int(maxPercent))
		}
	} else {
		if strings.Contains(str, ".") {
			return spec, errors.New(label + " (without %) must be a non-negative integer")
		}

		i, err := atoi(str)
		if err != nil {
			return spec, err
		}
		val = float64(i)
		if val < 0 {
			return spec, errors.New(label + " must be non-negative")
		}
	}
	return sizeSpec{val, percent}, nil
}

View on GitHub (pinned to bd4efa277b)