{"record":{"id":"435f26e395b95784","repo":"kovidgoyal/kitty","slug":"unknown-configuration-key-v","errorCode":null,"errorMessage":"Unknown configuration key: %#v","messagePattern":"Unknown configuration key: %#v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kitty/conf/generate.py","lineNumber":696,"sourceCode":"        a(f'func (x {oname}_Choice_Type) String() string {{')\n        a('switch x {')\n        a('default: return \"\"')\n        for c in choice_vals:\n            a(f'case {oname}_{cval(c)}: return \"{c}\"')\n        a('}}')\n        a(f'func {go_parsers[oname].split(\"(\")[0]}(val string) (ans {go_types[oname]}, err error) {{')\n        a('switch val {')\n        for c in choice_vals:\n            a(f'case \"{c}\": return {oname}_{cval(c)}, nil')\n        vals = ', '.join(choice_vals)\n        a(f'default: return ans, fmt.Errorf(\"%#v is not a valid value for %s. Valid values are: %s\", val, \"{c}\", \"{vals}\")')\n        a('}}')\n\n    has_parsers = bool(go_parsers or keyboard_shortcuts)\n    a('func (c *Config) Parse(key, val string) (err error) {')\n    if has_parsers:\n        a('switch key {')\n        a('default: return fmt.Errorf(\"Unknown configuration key: %#v\", key)')\n        for oname, pname in go_parsers.items():\n            ol = oname.lower()\n            is_multiple = oname in multiopts\n            a(f'case \"{ol}\":')\n            if is_multiple:\n                a(f'var temp_val []{go_types[oname]}')\n            else:\n                a(f'var temp_val {go_types[oname]}')\n            a(f'temp_val, err = {pname}')\n            a(f'if err != nil {{ return fmt.Errorf(\"Failed to parse {ol} = %#v with error: %w\", val, err) }}')\n            if is_multiple:\n                a(f'c.{oname} = append(c.{oname}, temp_val...)')\n            else:\n                a(f'c.{oname} = temp_val')\n        if keyboard_shortcuts:\n            a('case \"map\":')\n            a('tempsc, err := config.ParseMap(val)')\n            a('if err != nil { return fmt.Errorf(\"Failed to parse map = %#v with error: %w\", val, err) }')","sourceCodeStart":678,"sourceCodeEnd":714,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/conf/generate.py#L678-L714","documentation":"Generated into the Go Config.Parse method: when a config line's key doesn't match any known option (the switch falls through to default), the parser rejects it with 'Unknown configuration key'. This is the strict-key behavior for Go-embedded kitty config parsers used by kittens.","triggerScenarios":"Passing an unrecognized key in a config file parsed by the generated Go parser, via kitty -o bogus_key=value, or a remote control payload — e.g. a typo like 'font_familly' or an option only supported in the Python config layer, not the generated Go parser.","commonSituations":"Typos in option names; configs written for a newer kitty version than the Go parser was generated from; options that exist in kitty.conf but aren't part of the Go schema for a specific kitten; leftover deprecated keys after upgrades.","solutions":["Fix the typo — compare the key against kitty's documented option list","Comment out or remove the unknown key","Regenerate/upgrade to a kitty version whose generated Go parser knows the key","If the key is intentionally Python-only, move it out of files consumed by the Go parser"],"exampleFix":"# before\nfont_familly = Fira Code\n\n# after\nfont_family = Fira Code","handlingStrategy":"validation","validationCode":"knownKeys := map[string]bool{ /* generated from schema */ }\nif !knownKeys[key] {\n    return fmt.Errorf(\"skipping unknown key %q\", key)\n}","typeGuard":"func isKnownKey(key string, known map[string]bool) bool { return known[key] }","tryCatchPattern":"if err := cfg.Parse(key, val); err != nil {\n    if strings.Contains(err.Error(), \"Unknown configuration key\") {\n        log.Printf(\"warning: ignoring unknown key %q\", key)\n        continue\n    }\n    return err\n}","preventionTips":["Spell-check option names against kitty docs","Run kitty --debug-config to surface unknown keys early","Regenerate/upgrade parsers when adopting new options"],"tags":["kitty","config","unknown-key","generated-code"],"backgroundTag":"unknown-config-key","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}