{"record":{"id":"c2998a6891994e09","repo":"jesseduffield/lazygit","slug":"unrecognized-key-s-for-custom-command-prompt-op","errorCode":null,"errorMessage":"Unrecognized key '%s' for custom command prompt option. For permitted values see %s","messagePattern":"Unrecognized key '(.+?)' for custom command prompt option\\. For permitted values see (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/user_config_validation.go","lineNumber":238,"sourceCode":"\t\t\t\tif err := validateCustomCommandPrompt(prompt); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif err := validateEnum(\"customCommand.output\", customCommand.Output,\n\t\t\t\t[]string{\"\", \"none\", \"terminal\", \"log\", \"logWithPty\", \"popup\"}); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateCustomCommandPrompt(prompt CustomCommandPrompt) error {\n\tfor _, option := range prompt.Options {\n\t\tfor _, k := range option.Key {\n\t\t\tif !isValidKeybindingKey(k) {\n\t\t\t\treturn fmt.Errorf(\"Unrecognized key '%s' for custom command prompt option. For permitted values see %s\",\n\t\t\t\t\tk, constants.Links.Docs.CustomKeybindings)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":220,"sourceCodeEnd":246,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/config/user_config_validation.go#L220-L246","documentation":"Raised by validateCustomCommandPrompt in pkg/config/user_config_validation.go. For each option of every prompt in a custom command's `prompts` list, the option's Key binding elements are checked with isValidKeybindingKey; unrecognized key labels are rejected with a link to the keybindings docs.","triggerScenarios":"Declaring a custom command prompt with options whose key uses invalid notation, e.g. `prompts: [{type: menu, options: [{key: opt1, ...}]}]` where 'opt1' is not a valid key label — validated at startup.","commonSituations":"Users using short menu mnemonics ('y', '1') which can be valid, but writing things like 'option-one', 'F1', or 'ctrlX' which are not; forgetting that prompt option keys use the same key-label table as global keybindings.","solutions":["Change each prompt option key to a valid lazygit key label (single characters, 'a', ctrl+x, <f1>, digits, arrows).","Check the linked docs page for the exact spelling of multi-key labels.","Re-run lazygit to confirm validation passes."],"exampleFix":"# before\ncustomCommands:\n  - key: 'p'\n    command: echo {{.prompt.choice}}\n    prompts:\n      - type: menu\n        key: Choice\n        options:\n          - key: option-one\n            value: one\n\n# after\ncustomCommands:\n  - key: 'p'\n    command: echo {{.prompt.choice}}\n    prompts:\n      - type: menu\n        key: Choice\n        options:\n          - key: '1'\n            value: one","handlingStrategy":"validation","validationCode":"for _, cc := range cfg.CustomCommands {\n\tfor _, p := range cc.Prompts {\n\t\tfor _, opt := range p.Options {\n\t\t\tfor _, k := range opt.Key {\n\t\t\t\tif !validKeyRe.MatchString(k) {\n\t\t\t\t\treturn fmt.Errorf(\"prompt option key %q invalid\", k)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use single characters or canonical labels for prompt option keys.","Remember prompt options share the global key-label table — no free-form mnemonics."],"tags":["config","custom-commands","prompts","keybinding"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}