{"record":{"id":"501066c51988ac75","repo":"kovidgoyal/kitty","slug":"no-key-specified-after-flag-s","errorCode":null,"errorMessage":"No key specified after flag %s","messagePattern":"No key specified after flag (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/config/utils.go","lineNumber":276,"sourceCode":"func validateAllowFallback(value string) error {\n\tif value == \"\" || value == \"none\" {\n\t\treturn nil\n\t}\n\tfor part := range strings.SplitSeq(value, \",\") {\n\t\tpart = strings.TrimSpace(part)\n\t\tif part != \"shifted\" && part != \"ascii\" {\n\t\t\treturn fmt.Errorf(\"Invalid allow-fallback value %#v, allowed values: shifted, ascii, none\", part)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc ParseMap(val string) (*KeyAction, error) {\n\tallow_fallback := \"shifted\"\n\tfor strings.HasPrefix(val, \"--\") {\n\t\tflag, rest, found := strings.Cut(val, \" \")\n\t\tif !found {\n\t\t\treturn nil, fmt.Errorf(\"No key specified after flag %s\", flag)\n\t\t}\n\t\trest = strings.TrimSpace(rest)\n\t\tif name, value, ok := strings.Cut(flag, \"=\"); ok {\n\t\t\t// --flag=value form\n\t\t\tname = strings.ReplaceAll(name[2:], \"-\", \"_\")\n\t\t\tswitch name {\n\t\t\tcase \"allow_fallback\":\n\t\t\t\tif err := validateAllowFallback(value); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tif value == \"none\" {\n\t\t\t\t\tallow_fallback = \"\"\n\t\t\t\t} else {\n\t\t\t\t\tallow_fallback = value\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn nil, fmt.Errorf(\"Unknown map option: %s\", flag)\n\t\t\t}","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/config/utils.go#L258-L294","documentation":"ParseMap parses a map directive string; while consuming leading --flags it splits on the first space. If no space remains after the flag, there is no key spec left, so it errors naming the flag.","triggerScenarios":"A map value consisting only of flags, e.g. `--allow-fallback=none` with no trailing key/action, or ending in a flag with nothing after it.","commonSituations":"Truncated map lines after editing, or a flag consuming the rest of the line because the key/action was accidentally deleted.","solutions":["Append the key spec and action after the flag: `--allow-fallback=none ctrl+a 1`","Verify the whole map line wasn't cut off by a missing space"],"exampleFix":"# before\nmap --allow-fallback=none\n# after\nmap --allow-fallback=none ctrl+a 1","handlingStrategy":"validation","validationCode":"if !strings.Contains(val, \" \") { return fmt.Errorf(\"map directive lacks key/action after flags: %q\", val) }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always end map lines with key-spec plus action","Prefer --flag=value form to reduce ambiguity"],"tags":["config","map","validation","kitty"],"backgroundTag":"config-missing-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}