{"record":{"id":"219f51b686ff471d","repo":"jesseduffield/lazygit","slug":"unrecognized-key-s-for-keybinding-s-for-per","errorCode":null,"errorMessage":"Unrecognized key '%s' for keybinding '%s'. For permitted values see %s","messagePattern":"Unrecognized key '(.+?)' for keybinding '(.+?)'\\. For permitted values see (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/config/user_config_validation.go","lineNumber":171,"sourceCode":"\t\t\t} else {\n\t\t\t\tnewPath = fmt.Sprintf(\"%s.%s\", path, field.Name)\n\t\t\t}\n\t\t\tif err := validateKeybindingsRecurse(newPath,\n\t\t\t\tvalue.FieldByName(field.Name).Interface()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if value.Kind() == reflect.Slice {\n\t\tfor i := range value.Len() {\n\t\t\tif err := validateKeybindingsRecurse(\n\t\t\t\tfmt.Sprintf(\"%s[%d]\", path, i), value.Index(i).Interface()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t} else if value.Kind() == reflect.String {\n\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}","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/config/user_config_validation.go#L153-L189","documentation":"Raised by validateKeybindingsRecurse in pkg/config/user_config_validation.go. After config parsing, the whole KeybindingConfig tree is walked via reflection; every string leaf is checked against isValidKeybindingKey and anything unrecognized (wrong key name, wrong separator form, typo like <c-x> vs <c-x> variants or 'ctrlX') is rejected with a link to the custom keybindings docs.","triggerScenarios":"Any string under the keybinding section of the user config that isValidKeybindingKey does not accept — e.g. `universal.quit: ctrlq` instead of `ctrl+q`, or a key name not in lazygit's key label table — triggers this at startup validation.","commonSituations":"Migrating keybindings from other tools (vim/emacs notation); typos in '+' separators; keys supported only on some terminals or newer versions; copy-pasting from outdated docs.","solutions":["Rewrite the offending key using lazygit's notation as documented at constants.Links.Docs.CustomKeybindings (e.g. ctrl+q, alt+z, <c-u>, <pagedown>).","Check for missing '+' or angle brackets and stray whitespace.","If the key seems legitimate, verify it exists in lazygit's key label table for your version and update if needed."],"exampleFix":"# before\nkeybinding:\n  universal:\n    quit: ctrlq\n\n# after\nkeybinding:\n  universal:\n    quit: ctrl+q","handlingStrategy":"validation","validationCode":"// lazygit exposes the same check; in your own tooling keep a copy of the label table:\nvar validKeyRe = regexp.MustCompile(`^(ctrl|alt|cmd)\\+[a-z]$|^[a-zA-Z0-9]$|^<f[0-9]+>$`)\nif !validKeyRe.MatchString(key) {\n\treturn fmt.Errorf(\"suspicious keybinding value: %q\", key)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use ctrl+x / alt+x / <f1> notation consistently.","Diff your keybindings section after lazygit upgrades; label tables change between versions.","Keep the docs link from the error handy — it lists every permitted label."],"tags":["config","keybinding","validation"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}