{"record":{"id":"9a395712f2ee70c4","repo":"kovidgoyal/kitty","slug":"invalid-config-line-v","errorCode":null,"errorMessage":"Invalid config line: %#v","messagePattern":"Invalid config line: %#v","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"tools/config/api.go","lineNumber":195,"sourceCode":"\t\t\t\t} else {\n\t\t\t\t\tnext_line = \"\"\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tnext_line = \"\"\n\t\t}\n\n\t\tif line[0] == '#' {\n\t\t\tif self.CommentsHandler != nil {\n\t\t\t\tif err := self.CommentsHandler(line); err != nil {\n\t\t\t\t\tadd_bad_line(err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tm := key_pat().FindStringSubmatch(line)\n\t\tif len(m) < 3 {\n\t\t\tadd_bad_line(fmt.Errorf(\"Invalid config line: %#v\", line))\n\t\t\tcontinue\n\t\t}\n\t\tkey, val := m[1], m[2]\n\t\tfor i, ch := range line {\n\t\t\tif ch == ' ' || ch == '\\t' {\n\t\t\t\tkey = line[:i]\n\t\t\t\tval = strings.TrimSpace(line[i+1:])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tswitch key {\n\t\tdefault:\n\t\t\tif err := self.LineHandler(key, val); err != nil {\n\t\t\t\tadd_bad_line(err)\n\t\t\t}\n\t\tcase \"include\", \"globinclude\", \"envinclude\", \"geninclude\":\n\t\t\tvar includes []string\n\t\t\tval = ExpandVars(val)","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/config/api.go#L177-L213","documentation":"A line in a config file did not match the expected `key value` pattern and could not be parsed. The offending raw line is echoed with %#v formatting so exact whitespace/content is visible.","triggerScenarios":"Lines that are not blank, not comments, and lack a key/value separation matching the parser's key pattern — e.g. stray characters, malformed syntax, or a directive belonging to a different program's config.","commonSituations":"Pasting config snippets for a different kitty version that removed/renamed a directive, invisible Unicode characters, or a missing space between key and value.","solutions":["Locate the exact line using the %#v output in the error message","Correct the syntax to `key value` or remove the obsolete directive","Check the kitty docs for the current version to confirm the option still exists"],"exampleFix":"# before\nmap\n# after\nmap ctrl+a>1 goto_window 1","handlingStrategy":"try-catch","validationCode":"if !keyPat.MatchString(line) && !strings.HasPrefix(line, \"#\") && strings.TrimSpace(line) != \"\" {\n    log.Printf(\"suspicious config line: %q\", line)\n}","typeGuard":null,"tryCatchPattern":"if err := config.ParseFiles(\"kitten.conf\"); err != nil { log.Printf(\"config parse: %v\", err) /* treat as non-fatal */ }","preventionTips":["Validate configs in CI with kitty's config check before deploy","Avoid pasting snippets from other programs into kitten.conf"],"tags":["config","parse","syntax","kitty"],"backgroundTag":"config-parse-error","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}