{"record":{"id":"10c2dce700e8dcfc","repo":"junegunn/fzf","slug":"fzf-default-opts-s","errorCode":null,"errorMessage":"$FZF_DEFAULT_OPTS: %s","messagePattern":"\\$FZF_DEFAULT_OPTS: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3931,"sourceCode":"\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}\n\t\tif len(words) > 0 {\n\t\t\tif err := parseOptions(&index, opts, words); err != nil {\n\t\t\t\treturn nil, errors.New(\"$FZF_DEFAULT_OPTS: \" + err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\t// 3. Options from command-line arguments\n\tif err := parseOptions(&index, opts, args); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// 4. Change default scheme when built-in walker is used\n\tif len(opts.Scheme) == 0 {\n\t\topts.Scheme = \"default\"\n\t\tif len(opts.Criteria) == 0 {\n\t\t\t// NOTE: Let's assume $FZF_DEFAULT_COMMAND generates a list of file paths.","sourceCodeStart":3913,"sourceCodeEnd":3949,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3913-L3949","documentation":"The $FZF_DEFAULT_OPTS environment variable could not be tokenized: its string content has a shell-word syntax error such as an unterminated quote. This is the string counterpart of error 61 and aborts startup before command-line arguments are considered.","triggerScenarios":"FZF_DEFAULT_OPTS contains an unbalanced quote or bad escape, so parseShellWords(os.Getenv(\"FZF_DEFAULT_OPTS\")) fails.","commonSituations":"Complex exports in .bashrc/.zshrc where nested quoting for a --preview command goes wrong; values built by concatenation that lose a closing quote; copy-pasted shell lines with smart quotes.","solutions":["Inspect the variable: printf '%s\\n' \"$FZF_DEFAULT_OPTS\"","Rebalance the quoting, usually by wrapping the preview command in double quotes and inner paths in single quotes","Move complex options into $FZF_DEFAULT_OPTS_FILE where quoting is easier to get right"],"exampleFix":"# before\nexport FZF_DEFAULT_OPTS=\"--preview 'head -100 {}\"\n# after\nexport FZF_DEFAULT_OPTS=\"--preview 'head -100 {}'\"","handlingStrategy":"validation","validationCode":"# smoke-test the variable tokenizes as shell words\nif [ -n \"$FZF_DEFAULT_OPTS\" ]; then\n  eval \"set -- $FZF_DEFAULT_OPTS\" 2>/dev/null || { echo 'FZF_DEFAULT_OPTS has bad quoting' >&2; exit 1; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build the variable as a single-quoted string and double only what needs expansion","Prefer the file variant for anything beyond two or three simple flags"],"tags":["fzf","environment","quoting","startup"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}