{"record":{"id":"e249bc359dfbb9ba","repo":"kovidgoyal/kitty","slug":"allow-fallback-values-must-be-a-subset-of-shifted","errorCode":null,"errorMessage":"allow_fallback values must be a subset of shifted, ascii, got: {val}","messagePattern":"allow_fallback values must be a subset of shifted, ascii, got: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":1508,"sourceCode":"\nKeyboardModeMap = dict[str, KeyboardMode]\nkey_map_option_converters: defaultdict[str, Callable[[str], Any]] = defaultdict(lambda: lambda x: x)\nkey_map_option_converters['timeout'] = float\n\n\ndef _convert_allow_fallback(val: str) -> tuple[KeyFallbackType, ...]:\n    match val:\n        case 'shifted,ascii':\n            return (KeyFallbackType.shifted, KeyFallbackType.alternate)\n        case 'shifted':\n            return (KeyFallbackType.shifted,)\n        case '' | 'none':\n            return ()\n        case 'ascii,shifted':\n            return (KeyFallbackType.alternate, KeyFallbackType.shifted)\n        case 'ascii':\n            return (KeyFallbackType.alternate,)\n    raise ValueError(f'allow_fallback values must be a subset of shifted, ascii, got: {val}')\n\n\nkey_map_option_converters['allow_fallback'] = _convert_allow_fallback\n\n\ndef parse_options_for_map(val: str) -> tuple[KeyMapOptions, str]:\n    expecting_arg = ''\n    ans = KeyMapOptions()\n    s = Shlex(val)\n    while (tok := s.next_word())[0] > -1:\n        x = tok[1]\n        if expecting_arg:\n            object.__setattr__(ans, expecting_arg, key_map_option_converters[expecting_arg](x))\n            expecting_arg = ''\n        elif x.startswith('--'):\n            expecting_arg = x[2:]\n            k, sep, v = expecting_arg.partition('=')\n            k = k.replace('-', '_')","sourceCodeStart":1490,"sourceCodeEnd":1526,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1490-L1526","documentation":"The allow_fallback key-map option accepts only '', 'none', 'ascii', or 'ascii,shifted' (via a match statement); any other string raises this ValueError.","triggerScenarios":"Passing '--allow-fallback=shifted' (unsupported order), '--allow-fallback=all', or any unrecognized combination in a map line.","commonSituations":"Assuming any subset order works; the parser literally matches only the three exact strings plus empty/none.","solutions":["Use exactly one of: (empty), none, ascii, or ascii,shifted","Write the combined value in the exact order 'ascii,shifted'"],"exampleFix":"# before\nmap --allow-fallback=shifted f1 copy_to_clipboard\n# after\nmap --allow-fallback=ascii,shifted f1 copy_to_clipboard","handlingStrategy":"validation","validationCode":"def valid_allow_fallback(v: str) -> bool:\n    return v in ('', 'none', 'ascii', 'ascii,shifted')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact literal spellings; order matters"],"tags":["kitty","config","keybindings","validation"],"backgroundTag":"enum-value-invalid","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}