{"record":{"id":"173a90888eea3976","repo":"junegunn/fzf","slug":"minimum-height-must-be-a-non-negative-integer","errorCode":null,"errorMessage":"minimum height must be a non-negative integer","messagePattern":"minimum height must be a non-negative integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3219,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif opts.Height, err = parseHeight(str, index); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\tcase \"--min-height\":\n\t\t\texpr, err := nextString(\"minimum height required: HEIGHT[+]\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tauto := false\n\t\t\tif strings.HasSuffix(expr, \"+\") {\n\t\t\t\texpr = expr[:len(expr)-1]\n\t\t\t\tauto = true\n\t\t\t}\n\t\t\tnum, err := atoi(expr)\n\t\t\tif err != nil || num < 0 {\n\t\t\t\treturn errors.New(\"minimum height must be a non-negative integer\")\n\t\t\t}\n\t\t\tif auto {\n\t\t\t\tnum *= -1\n\t\t\t}\n\t\t\topts.MinHeight = num\n\t\tcase \"--no-height\":\n\t\t\topts.Height = heightSpec{}\n\t\tcase \"--no-margin\":\n\t\t\topts.Margin = defaultMargin()\n\t\tcase \"--no-padding\":\n\t\t\topts.Padding = defaultMargin()\n\t\tcase \"--no-border\":\n\t\t\topts.BorderShape = tui.BorderNone\n\t\tcase \"--border\":\n\t\t\thasArg, arg := optionalNextString()\n\t\t\tif opts.BorderShape, err = parseBorder(arg, !hasArg); err != nil {\n\t\t\t\treturn err\n\t\t\t}","sourceCodeStart":3201,"sourceCodeEnd":3237,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3201-L3237","documentation":"Thrown when --min-height's numeric part fails atoi or is negative. The option accepts HEIGHT optionally suffixed with '+' (meaning 'auto-grow allowed', internally stored as a negative number); if the remaining expression is not a valid non-negative integer, the error fires. Note percentages are handled elsewhere (parseSize).","triggerScenarios":"`--min-height abc`, `--min-height -10`, `--min-height 5.5`, or `--min-height +5` (the '+' must be a suffix: '5+', not a prefix).","commonSituations":"Placing the auto-grow '+' before the number; passing computed values containing spaces or decimals; confusing --min-height semantics with --height's negative/percent forms.","solutions":["Use a plain non-negative integer: `--min-height 10`","Put the '+' suffix for auto-grow: `--min-height 10+`","Sanitize computed values to integers (strip decimals, clamp >= 0) before passing"],"exampleFix":"# before\nfzf --min-height +5\n# after\nfzf --min-height 5+","handlingStrategy":"validation","validationCode":"# bash: HEIGHT or HEIGHT+ only\n[[ \"$MH\" =~ ^[0-9]+\\+?$ ]] || MH=10\nfzf --min-height \"$MH\"","typeGuard":"min_height_ok() { [[ \"$1\" =~ ^[0-9]+\\+?$ ]]; }","tryCatchPattern":null,"preventionTips":["Remember the '+' is a suffix (10+), not a prefix","Validate against ^[0-9]+\\+?$ before passing user input"],"tags":["fzf","go","cli","size","validation"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}