{"record":{"id":"42e82d3c077c084e","repo":"junegunn/fzf","slug":"fzf-default-opts-file-s","errorCode":null,"errorMessage":"$FZF_DEFAULT_OPTS_FILE: %s","messagePattern":"\\$FZF_DEFAULT_OPTS_FILE: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3914,"sourceCode":"}\n\nfunc parseShellWords(str string) ([]string, error) {\n\tparser := shellwords.NewParser()\n\tparser.ParseComment = true\n\treturn parser.Parse(str)\n}\n\n// ParseOptions parses command-line options\nfunc ParseOptions(useDefaults bool, args []string) (*Options, error) {\n\topts := defaultOptions()\n\tindex := 0\n\n\tif useDefaults {\n\t\t// 1. Options from $FZF_DEFAULT_OPTS_FILE\n\t\tif path := os.Getenv(\"FZF_DEFAULT_OPTS_FILE\"); path != \"\" {\n\t\t\tbytes, err := os.ReadFile(path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.New(\"$FZF_DEFAULT_OPTS_FILE: \" + err.Error())\n\t\t\t}\n\n\t\t\twords, parseErr := parseShellWords(string(bytes))\n\t\t\tif parseErr != nil {\n\t\t\t\treturn nil, errors.New(path + \": \" + parseErr.Error())\n\t\t\t}\n\t\t\tif len(words) > 0 {\n\t\t\t\tif err := parseOptions(&index, opts, words); err != nil {\n\t\t\t\t\treturn nil, errors.New(path + \": \" + err.Error())\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// 2. Options from $FZF_DEFAULT_OPTS string\n\t\twords, parseErr := parseShellWords(os.Getenv(\"FZF_DEFAULT_OPTS\"))\n\t\tif parseErr != nil {\n\t\t\treturn nil, errors.New(\"$FZF_DEFAULT_OPTS: \" + parseErr.Error())\n\t\t}","sourceCodeStart":3896,"sourceCodeEnd":3932,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3896-L3932","documentation":"fzf failed to read the file pointed to by the $FZF_DEFAULT_OPTS_FILE environment variable. The file is read before any other option source, so a broken path aborts startup entirely. The underlying OS error (e.g. 'no such file or directory', 'permission denied') is appended after the prefix.","triggerScenarios":"ParseOptions(useDefaults=true, args) is called (normal fzf startup) and $FZF_DEFAULT_OPTS_FILE is set to a path that os.ReadFile cannot read: missing file, dangling symlink, directory, or unreadable permissions.","commonSituations":"Shell rc files exporting a stale path after the file was moved or deleted; typos in the export line; pointing at a file on an unmounted volume; CI containers where the dotfile was never copied in.","solutions":["Check the variable points to an existing readable file: echo $FZF_DEFAULT_OPTS_FILE && cat \"$FZF_DEFAULT_OPTS_FILE\"","Fix the path in your shell rc file, or unset the variable if the file is no longer needed","Verify permissions: the file must be readable by the user running fzf (chmod u+r)"],"exampleFix":"# before\nexport FZF_DEFAULT_OPTS_FILE=~/.config/fzf/opts   # wrong path\n# after\nexport FZF_DEFAULT_OPTS_FILE=\"$HOME/.config/fzf/opts\"\n# or remove it if unused\nunset FZF_DEFAULT_OPTS_FILE","handlingStrategy":"validation","validationCode":"# before starting fzf\nif [ -n \"$FZF_DEFAULT_OPTS_FILE\" ] && [ ! -r \"$FZF_DEFAULT_OPTS_FILE\" ]; then\n  echo \"FZF_DEFAULT_OPTS_FILE unreadable: $FZF_DEFAULT_OPTS_FILE\" >&2\n  unset FZF_DEFAULT_OPTS_FILE\nfi\nfzf","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export FZF_DEFAULT_OPTS_FILE only after verifying the file exists in the same rc block","Point it at a file inside a directory you own and version-control it with your dotfiles"],"tags":["fzf","environment","config","startup"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}