{"record":{"id":"be6bafa39f434071","repo":"kovidgoyal/kitty","slug":"shortcut-sc-has-unknown-modifier-ignoring","errorCode":null,"errorMessage":"Shortcut: {sc} has unknown modifier, ignoring","messagePattern":"Shortcut: (.+?) has unknown modifier, ignoring","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":517,"sourceCode":"def load_config_file(func: str, rest: str) -> FuncArgsType:\n    return func, list(shlex_split(rest))\n\n\n# }}}\n\n\ndef parse_mods(parts: Iterable[str], sc: str) -> int | None:\n\n    def map_mod(m: str) -> str:\n        return mod_map.get(m, m)\n\n    mods = 0\n    for m in parts:\n        try:\n            mods |= getattr(defines, f'GLFW_MOD_{map_mod(m.upper())}')\n        except AttributeError:\n            if m.upper() != 'NONE':\n                log_error(f'Shortcut: {sc} has unknown modifier, ignoring')\n            return None\n\n    return mods\n\n\ndef to_modifiers(val: str) -> int:\n    return parse_mods(val.split('+'), val) or 0\n\n\ndef remap_modifiers(val: str) -> dict[int, int]:\n    # Only the real modifiers may be remapped. parse_mods() also accepts\n    # kitty_mod (a parse-time placeholder resolved out of keymaps before any key\n    # event exists) and the lock modifiers, neither of which can be meaningfully\n    # carried on an event, so they are rejected here rather than silently\n    # mangling events later.\n    ans = {}\n    if not val:\n        return ans","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L499-L535","documentation":"While parsing a shortcut/mouse-map modifier list, a token did not map to any GLFW_MOD_* constant, so kitty discards the whole shortcut (parse_mods returns None). Unlike most kitty fallbacks, this one removes the mapping entirely.","triggerScenarios":"`map ctrl+alt+x ...` is fine, but `map ctrl+win+hyper+meat+x ...` fails because 'meat' has no defines.GLFW_MOD_MEAT; also 'NONE' mixed with other mods is silently ignored without logging.","commonSituations":"Typos in modifier names (ctrl, shift, alt, super/cmd, hyper, meta), platform-specific names like 'option' or 'command' instead of kitty's 'alt'/'super'.","solutions":["Use kitty's modifier names: ctrl, shift, alt, super, hyper, meta (plus platform mapping via map_mod e.g. cmd/apple on macOS)","Fix typos in the modifier portion of the map/mouse_map line"],"exampleFix":"# before\nmap ctrl+meat+t new_tab\n# after\nmap ctrl+meta+t new_tab","handlingStrategy":"validation","validationCode":"mods = 'ctrl+meta'.split('+')\nfrom kitty import defines\nok = all(hasattr(defines, f'GLFW_MOD_{m.upper()}') for m in mods)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use kitty's modifier names: ctrl, shift, alt, super, hyper, meta","A single bad modifier drops the whole map — proofread modifier chains","Watch stderr on config reload for 'Unknown modifier' messages"],"tags":["kitty","config","keyboard","modifiers","parser"],"backgroundTag":"invalid-keybinding-modifier","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}