{"record":{"id":"bb2d6646b84dd6b3","repo":"wagoodman/dive","slug":"failed-to-parse-key-q-w","errorCode":null,"errorMessage":"failed to parse key %q: %w","messagePattern":"failed to parse key %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/dive/cli/internal/ui/v1/key/config.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"fmt\"\n\t\"github.com/awesome-gocui/keybinding\"\n)\n\ntype Config struct {\n\tInput string\n\tKeys  []keybinding.Key `yaml:\"-\" mapstructure:\"-\"`\n}\n\nfunc (c *Config) Setup() error {\n\tif len(c.Input) == 0 {\n\t\treturn nil\n\t}\n\n\tparsed, err := keybinding.ParseAll(c.Input)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse key %q: %w\", c.Input, err)\n\t}\n\tc.Keys = parsed\n\treturn nil\n}\n\ntype Bindings struct {\n\tGlobal     GlobalBindings     `yaml:\",inline\" mapstructure:\",squash\"`\n\tNavigation NavigationBindings `yaml:\",inline\" mapstructure:\",squash\"`\n\tLayer      LayerBindings      `yaml:\",inline\" mapstructure:\",squash\"`\n\tFiletree   FiletreeBindings   `yaml:\",inline\" mapstructure:\",squash\"`\n}\n\ntype GlobalBindings struct {\n\tQuit             Config `yaml:\"quit\" mapstructure:\"quit\"`\n\tToggleView       Config `yaml:\"toggle-view\" mapstructure:\"toggle-view\"`\n\tFilterFiles      Config `yaml:\"filter-files\" mapstructure:\"filter-files\"`\n\tCloseFilterFiles Config `yaml:\"close-filter-files\" mapstructure:\"close-filter-files\"`\n}","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/wagoodman/dive/blob/d6c691947f8fda635c952a17ee3b7555379d58f0/cmd/dive/cli/internal/ui/v1/key/config.go#L2-L38","documentation":"Thrown by keybinding Config.Setup() when keybinding.ParseAll() cannot parse the configured key string. ParseAll splits the input on delimiters and translates each token into a gocui key; any unrecognized key name or modifier combination yields this error with the raw input quoted.","triggerScenarios":"A dive.yaml keybinding value with invalid key names or syntax: 'ctrl+shift+x' variants unsupported by the parser, typos like 'conrtol+a', platform-specific names ('cmd+f' on Linux), or stray characters after the key.","commonSituations":"Copy-pasting keybindings from another tool's config (vim/tmux syntax like '<C-a>'); macOS users porting cmd-based shortcuts; version changes that renamed keys.","solutions":["Check the quoted input in the message and correct it to a single supported key spec such as 'tab', 'ctrl+t', 'f5', or 'ctrl+shift+d' as supported by the keybinding package.","Avoid tool-specific notation (<C-a>, cmd+); use dive's documented key names.","Test with one simple binding first, then restore the rest.","Reset the keybinding section to defaults and re-apply changes incrementally."],"exampleFix":"# before (dive.yaml)\nkeybinding:\n  global:\n    quit: <C-c>   # vim-style -> failed to parse key \"<C-c>\"\n\n# after\nkeybinding:\n  global:\n    quit: ctrl+c","handlingStrategy":"validation","validationCode":"# sanity-check key syntax before launch (dive uses gocui-style specs)\ngrep -E '(<C-|cmd\\+|meta\\+)' dive.yaml && echo \"unsupported key notation\" && exit 1 || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use dive's documented key specs: 'ctrl+x', 'shift+tab', 'f1'..'f12', 'enter', 'esc'.","Do not port vim/tmux/macOS notation directly.","Introduce custom bindings one at a time to isolate parse failures."],"tags":["dive","tui","keybinding","configuration","yaml"],"backgroundTag":null,"analyzedSha":"d6c691947f8fda635c952a17ee3b7555379d58f0","analyzedAt":"2026-08-15T09:42:35.293Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}