{"record":{"id":"b01e6b90b5967176","repo":"junegunn/fzf","slug":"invalid-algorithm-expected-v1-or-v2","errorCode":null,"errorMessage":"invalid algorithm (expected: v1 or v2)","messagePattern":"invalid algorithm \\(expected: v1 or v2\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":960,"sourceCode":"\treturn Delimiter{regex: rx}\n}\n\nfunc isAlphabet(char uint8) bool {\n\treturn char >= 'a' && char <= 'z'\n}\n\nfunc isNumeric(char uint8) bool {\n\treturn char >= '0' && char <= '9'\n}\n\nfunc parseAlgo(str string) (algo.Algo, error) {\n\tswitch str {\n\tcase \"v1\":\n\t\treturn algo.FuzzyMatchV1, nil\n\tcase \"v2\":\n\t\treturn algo.FuzzyMatchV2, nil\n\t}\n\treturn nil, errors.New(\"invalid algorithm (expected: v1 or v2)\")\n}\n\nfunc parseBorder(str string, optional bool) (tui.BorderShape, error) {\n\tswitch str {\n\tcase \"line\":\n\t\treturn tui.BorderLine, nil\n\tcase \"inline\":\n\t\treturn tui.BorderInline, nil\n\tcase \"rounded\":\n\t\treturn tui.BorderRounded, nil\n\tcase \"sharp\":\n\t\treturn tui.BorderSharp, nil\n\tcase \"bold\":\n\t\treturn tui.BorderBold, nil\n\tcase \"block\":\n\t\treturn tui.BorderBlock, nil\n\tcase \"thinblock\":\n\t\treturn tui.BorderThinBlock, nil","sourceCodeStart":942,"sourceCodeEnd":978,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L942-L978","documentation":"parseAlgo maps the --algo flag to a fuzzy matcher implementation. Only 'v1' (original fzf algorithm) and 'v2' (fzf 0.15+ default, better scoring) are accepted; anything else — including legacy names like 'v3', typos, or empty strings — returns this error.","triggerScenarios":"fzf --algo v3, --algo=V2 (uppercase not matched), --algo '' from an unset exported FZF_DEFAULT_OPTS=\"--algo $ALGO\" with ALGO empty, or scripts written against third-party forks that accept other algorithm names.","commonSituations":"Shell profiles exporting FZF_DEFAULT_OPTS with a typo'd algorithm; copy-pasted dotfiles referencing algorithms from skim/fzy ('fzy', 'clangd'); version drift where a user assumes a 'v3' exists.","solutions":["Use exactly v1 or v2 (lowercase): fzf --algo v2","Remove the --algo flag entirely to get the default (v2)","Grep your shell rc files: grep -Rn 'algo' ~/.bashrc ~/.zshrc ~/.config/fzf","If a different matcher is wanted, use --exact or --scheme instead of inventing --algo values"],"exampleFix":"# before\nexport FZF_DEFAULT_OPTS='--algo fuzzy'\n# after\nexport FZF_DEFAULT_OPTS='--algo v2'","handlingStrategy":"validation","validationCode":"case \"${ALGO:=v2}\" in v1|v2) ;; *) echo \"invalid --algo: $ALGO\" >&2; exit 1;; esac\nfzf --algo \"$ALGO\"","typeGuard":"isValidFzfAlgo() { case \"$1\" in v1|v2) return 0;; *) return 1;; esac; }","tryCatchPattern":null,"preventionTips":["Whitelist --algo to {v1, v2} at the point of configuration","Omit --algo unless you specifically need v1 behavior","grep your rc files after upgrading fzf to catch stale algorithm names"],"tags":["fzf","options-parsing","algorithm","configuration","go"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}