{"record":{"id":"fa2478dd8688f2dd","repo":"kovidgoyal/kitty","slug":"invalid-allow-fallback-value-v-allowed-values","errorCode":null,"errorMessage":"Invalid allow-fallback value %#v, allowed values: shifted, ascii, none","messagePattern":"Invalid allow-fallback value %#v, allowed values: shifted, ascii, none","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/config/utils.go","lineNumber":265,"sourceCode":"type KeyAction struct {\n\tNormalized_keys []string\n\tName            string\n\tArgs            string\n\tAllowFallback   string\n}\n\nfunc (self *KeyAction) String() string {\n\treturn fmt.Sprintf(\"map %#v %#v %#v\\n\", strings.Join(self.Normalized_keys, \">\"), self.Name, self.Args)\n}\n\nfunc 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\":","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/config/utils.go#L247-L283","documentation":"The allow-fallback value for a map directive must be one of shifted, ascii, none (or a comma-separated list of shifted/ascii). validateAllowFallback rejects any other token when parsing the map option.","triggerScenarios":"Passing --allow-fallback=xyz or `--allow-fallback xyz` to a map directive in a config file, where xyz is not shifted, ascii, none, or a comma list of those.","commonSituations":"Typos like 'shfted' or 'ASCII' (case-sensitive), or assuming legacy values from older kitty versions where this validation did not exist.","solutions":["Change the value to shifted, ascii, none, or a comma combination like shifted,ascii","Check spelling and case exactly","If upgrading, review changelog notes about allow-fallback semantics"],"exampleFix":"# before\nmap --allow-fallback=Shifted ctrl+a 1\n# after\nmap --allow-fallback=shifted ctrl+a 1","handlingStrategy":"validation","validationCode":"valid := map[string]bool{\"shifted\": true, \"ascii\": true, \"none\": true, \"\": true}\nfor _, p := range strings.Split(value, \",\") {\n    p = strings.TrimSpace(p)\n    if !valid[p] { return fmt.Errorf(\"bad allow-fallback %q\", p) }\n}","typeGuard":"func isValidAllowFallback(v string) bool {\n    if v == \"\" || v == \"none\" { return true }\n    for _, p := range strings.Split(v, \",\") {\n        p = strings.TrimSpace(p)\n        if p != \"shifted\" && p != \"ascii\" { return false }\n    }\n    return true\n}","tryCatchPattern":null,"preventionTips":["Use exactly shifted, ascii, none in lowercase","Prefer the comma form without spaces: shifted,ascii"],"tags":["config","map","validation","kitty"],"backgroundTag":"config-invalid-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}