{"record":{"id":"55ecd65132c11be4","repo":"jesseduffield/lazygit","slug":"unknown-value-for-suggestionspreset-in-custom-comm","errorCode":null,"errorMessage":"Unknown value for suggestionsPreset in custom command: %s. Valid values: files, branches, remotes, remoteBranches, refs","messagePattern":"Unknown value for suggestionsPreset in custom command: (.+?)\\. Valid values: files, branches, remotes, remoteBranches, refs","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/gui/services/custom_commands/handler_creator.go","lineNumber":214,"sourceCode":"\nfunc (self *HandlerCreator) getPresetSuggestionsFn(preset string) (func(string) []*types.Suggestion, error) {\n\tswitch preset {\n\tcase \"authors\":\n\t\treturn self.suggestionsHelper.GetAuthorsSuggestionsFunc(), nil\n\tcase \"branches\":\n\t\treturn self.suggestionsHelper.GetBranchNameSuggestionsFunc(), nil\n\tcase \"files\":\n\t\treturn self.suggestionsHelper.GetFilePathSuggestionsFunc(), nil\n\tcase \"refs\":\n\t\treturn self.suggestionsHelper.GetRefsSuggestionsFunc(), nil\n\tcase \"remotes\":\n\t\treturn self.suggestionsHelper.GetRemoteSuggestionsFunc(), nil\n\tcase \"remoteBranches\":\n\t\treturn self.suggestionsHelper.GetRemoteBranchesSuggestionsFunc(\"/\"), nil\n\tcase \"tags\":\n\t\treturn self.suggestionsHelper.GetTagsSuggestionsFunc(), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Unknown value for suggestionsPreset in custom command: %s. Valid values: files, branches, remotes, remoteBranches, refs\", preset)\n\t}\n}\n\nfunc (self *HandlerCreator) confirmPrompt(prompt *config.CustomCommandPrompt, handleConfirm func() error) error {\n\tself.c.Confirm(types.ConfirmOpts{\n\t\tTitle:         prompt.Title,\n\t\tPrompt:        prompt.Body,\n\t\tHandleConfirm: handleConfirm,\n\t})\n\n\treturn nil\n}\n\nfunc (self *HandlerCreator) menuPrompt(prompt *config.CustomCommandPrompt, wrappedF func(string) error) error {\n\tmenuItems := lo.Map(prompt.Options, func(option config.CustomCommandMenuOption, _ int) *types.MenuItem {\n\t\treturn &types.MenuItem{\n\t\t\tLabelColumns: []string{option.Name, style.FgYellow.Sprint(option.Description)},\n\t\t\tOnPress: func() error {","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/gui/services/custom_commands/handler_creator.go#L196-L232","documentation":"Thrown by HandlerCreator.getPresetSuggestionsFn when a prompt's 'suggestions.preset' value does not match any case in its switch. Note the error text lists 'files, branches, remotes, remoteBranches, refs' but the switch also accepts 'tags' — the message is slightly stale; in practice valid values are files, branches, remotes, remoteBranches, refs, tags.","triggerScenarios":"Setting suggestions.preset to a typo or unsupported name: 'file' instead of 'files', 'Branches' (capitalized), 'localBranches', or 'commits'. Any string outside the switch cases hits default and return this error.","commonSituations":"Typos in hand-written config; using a preset name from a newer/older lazygit version than the docs being read; guessing a plausible name like 'tags' on a version whose message omits it (tags actually works) or 'authors' (does not exist).","solutions":["Correct the preset to one of: files, branches, remotes, remoteBranches, refs, tags","If you need a source not in the list (e.g. authors, commits), switch to suggestions.command with a shell command that prints candidates"],"exampleFix":"# before\nsuggestions:\n  preset: file\n\n# after\nsuggestions:\n  preset: files","handlingStrategy":"validation","validationCode":"# yq check against the full valid set (note: 'tags' is valid even though the error text omits it)\nyq '.customCommands[].prompts[].suggestions.preset? | select(. != \"files\" and . != \"branches\" and . != \"remotes\" and . != \"remoteBranches\" and . != \"refs\" and . != \"tags\")' ~/.config/lazygit/config.yml","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy preset names verbatim from the version-matched docs, not from memory","If a source isn't in the list, use suggestions.command with a shell command instead"],"tags":["lazygit","custom-commands","config","suggestions","typo"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}