{"record":{"id":"3517866dd4e3e641","repo":"junegunn/fzf","slug":"invalid-preview-window-option-token","errorCode":null,"errorMessage":"invalid preview window option: ${token}","messagePattern":"invalid preview window option: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":2419,"sourceCode":"\t\tcase \"nofollow\":\n\t\t\topts.follow = false\n\t\tcase \"info\":\n\t\t\topts.info = true\n\t\tcase \"noinfo\":\n\t\t\topts.info = false\n\t\tdefault:\n\t\t\tif headerRegex.MatchString(token) {\n\t\t\t\tif opts.headerLines, err = atoi(token[1:]); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else if sizeRegex.MatchString(token) {\n\t\t\t\tif opts.size, err = parseSize(token, 99, \"window size\"); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else if offsetRegex.MatchString(token) {\n\t\t\t\topts.scroll = token\n\t\t\t} else {\n\t\t\t\treturn errors.New(\"invalid preview window option: \" + token)\n\t\t\t}\n\t\t}\n\t}\n\tif len(alternative) > 0 {\n\t\talternativeOpts := *opts\n\t\topts.alternative = &alternativeOpts\n\t\topts.alternative.hidden = false\n\t\topts.alternative.alternative = nil\n\t\terr = parsePreviewWindowImpl(opts.alternative, alternative)\n\t}\n\treturn err\n}\n\nfunc parseMargin(opt string, margin string) ([4]sizeSpec, error) {\n\tmargins := strings.Split(margin, \",\")\n\tchecked := func(str string) (sizeSpec, error) {\n\t\treturn parseSize(str, 49, opt)\n\t}","sourceCodeStart":2401,"sourceCodeEnd":2437,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L2401-L2437","documentation":"Thrown by parsePreviewWindowImpl while tokenizing the --preview-window option. Each comma-separated token must match a known flag (hidden, nohidden, wrap, nowrap, cycle, border-*, down, up, left, right), a header spec (~N), a size (N or N%), or a scroll offset (+N, -N, +{n}, -/N); anything else lands in this default branch and is rejected after all regexes fail.","triggerScenarios":"`--preview-window 'tight'` (old fzf token removed), `--preview-window 'right:60:xx'`, `--preview-window 'border-rounded,'` trailing garbage, or a mistyped size like '5O%' (letter O).","commonSituations":"Carrying over 'tight'/'nohtight' from fzf <= 0.20 configs where tight was valid — it was later replaced by 'border-none' behavior; version upgrades breaking old alias scripts; unquoted specs where the shell splits or expands tokens.","solutions":["Replace removed tokens: 'tight' -> drop it or use 'border-none'; 'nohtight' likewise","Check the man page (fzf --man) for the current token list and fix typos","Split multi-token specs into repeated --preview-window flags to isolate the bad token"],"exampleFix":"# before (fzf <= 0.20 style)\nfzf --preview-window right:50%:tight\n# after\nfzf --preview-window right:50%:border-none","handlingStrategy":"validation","validationCode":"# bash: screen tokens against the known vocabulary\ntoken_ok() {\n  [[ \"$1\" =~ ^(hidden|nohidden|wrap|nowrap|cycle|nocycle|up|down|left|right|border|border-rounded|border-square|border-bold|border-block|border-thinblock|border-double|noborder|border-sharp|border-horizontal|border-vertical|border-top|border-bottom|border-left|border-right|follow|nofollow)$ ]] ||\n  [[ \"$1\" =~ ^[0-9]+%?$ ]] || [[ \"$1\" =~ ^(\\+\\{-?[0-9]+|n\\}|[+-][0-9]+|-?/[1-9][0-9]*)+$ ]] || [[ \"$1\" =~ ^~(0|[1-9][0-9]*)$ ]]\n}\nIFS=',' read -ra T <<< \"$PW\"; for t in \"${T[@]}\"; do token_ok \"$t\" || echo \"bad token: $t\" >&2; done","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After fzf upgrades, grep old configs for removed tokens like 'tight'","Quote the whole --preview-window value so commas reach fzf intact"],"tags":["fzf","go","cli","preview","parsing","version-compat"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}