{"record":{"id":"b117a671e926a67f","repo":"jesseduffield/lazygit","slug":"unrecognized-key-s-for-custom-command-for-perm","errorCode":null,"errorMessage":"Unrecognized key '%s' for custom command. For permitted values see %s","messagePattern":"Unrecognized key '(.+?)' for custom command\\. For permitted values see (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/user_config_validation.go","lineNumber":187,"sourceCode":"\t\tkey := node.(string)\n\t\tif !isValidKeybindingKey(key) {\n\t\t\treturn fmt.Errorf(\"Unrecognized key '%s' for keybinding '%s'. For permitted values see %s\",\n\t\t\t\tkey, path, constants.Links.Docs.CustomKeybindings)\n\t\t}\n\t} else {\n\t\tlog.Fatalf(\"Unexpected type for property '%s': %s\", path, value.Kind())\n\t}\n\treturn nil\n}\n\nfunc validateKeybindings(keybindingConfig KeybindingConfig) error {\n\treturn validateKeybindingsRecurse(\"\", keybindingConfig)\n}\n\nfunc validateCustomCommandKey(key Keybinding) error {\n\tfor _, k := range key {\n\t\tif !isValidKeybindingKey(k) {\n\t\t\treturn fmt.Errorf(\"Unrecognized key '%s' for custom command. For permitted values see %s\",\n\t\t\t\tk, constants.Links.Docs.CustomKeybindings)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateCustomCommands(customCommands []CustomCommand) error {\n\tfor _, customCommand := range customCommands {\n\t\tif err := validateCustomCommandKey(customCommand.Key); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif len(customCommand.CommandMenu) > 0 {\n\t\t\tif len(customCommand.Context) > 0 ||\n\t\t\t\tlen(customCommand.Command) > 0 ||\n\t\t\t\tlen(customCommand.Prompts) > 0 ||\n\t\t\t\tlen(customCommand.LoadingText) > 0 ||\n\t\t\t\tlen(customCommand.Output) > 0 ||","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/config/user_config_validation.go#L169-L205","documentation":"Raised by validateCustomCommandKey in pkg/config/user_config_validation.go. Each custom command's `key` field is a Keybinding ([]string after unmarshalling); every element is checked with isValidKeybindingKey and an unrecognized key name is rejected with a docs link. Unlike error 146 this checks only customCommands entries, not the built-in keybinding tree.","triggerScenarios":"Defining customCommands: [{key: 'ctrlX', command: ...}] where 'ctrlX' is not a valid key label — validation runs at startup right after the built-in keybinding pass.","commonSituations":"Users adding custom commands with ad-hoc key notation ('F1' vs '<f1>', 'ctrl-x' vs 'ctrl+x'); list-form keys where only one element is malformed.","solutions":["Rewrite the custom command's key in canonical lazygit notation (ctrl+x, alt+p, <f5>).","If the key is a list, check every element — the error names the exact offending one.","See the linked custom keybindings docs for the full label table."],"exampleFix":"# before\ncustomCommands:\n  - key: ctrlX\n    command: git status\n\n# after\ncustomCommands:\n  - key: ctrl+x\n    command: git status","handlingStrategy":"validation","validationCode":"for _, cc := range cfg.CustomCommands {\n\tfor _, k := range cc.Key {\n\t\tif !validKeyRe.MatchString(k) {\n\t\t\treturn fmt.Errorf(\"custom command key %q invalid\", k)\n\t\t}\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the same key-label notation in customCommands as in the main keybinding section.","Validate dotfile configs in CI with `lazygit --use-config-file` smoke start before pushing."],"tags":["config","custom-commands","keybinding"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}