{"record":{"id":"dca21d41e78cec99","repo":"kovidgoyal/kitty","slug":"shortcut-sc-has-unknown-key-ignoring","errorCode":null,"errorMessage":"Shortcut: {sc} has unknown key, ignoring","messagePattern":"Shortcut: (.+?) has unknown key, ignoring","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":1567,"sourceCode":"                sc = parts[0]\n                action = ' '.join(parts[1:])\n    else:\n        sc, action = val, ''\n    sc, action = sc.strip().strip(sequence_sep), action.strip()\n    if not sc:\n        return\n    is_sequence = sequence_sep in sc\n    if is_sequence:\n        trigger: SingleKey | None = None\n        restl: list[SingleKey] = []\n        for part in sc.split(sequence_sep):\n            try:\n                mods, is_native, key = parse_shortcut(part)\n            except InvalidMods:\n                return\n            if key == 0:\n                if mods is not None:\n                    log_error(f'Shortcut: {sc} has unknown key, ignoring')\n                return\n            if trigger is None:\n                trigger = SingleKey(mods, is_native, key)\n            else:\n                restl.append(SingleKey(mods, is_native, key))\n        rest = tuple(restl)\n    else:\n        try:\n            mods, is_native, key = parse_shortcut(sc)\n        except InvalidMods:\n            return\n        if key == 0:\n            if mods is not None:\n                log_error(f'Shortcut: {sc} has unknown key, ignoring')\n            return\n    if is_sequence:\n        if trigger is not None:\n            yield KeyDefinition(True, trigger, rest, definition=action, options=options)","sourceCodeStart":1549,"sourceCodeEnd":1585,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1549-L1585","documentation":"While parsing a multi-key shortcut sequence, one part parsed with key == 0 but had valid modifiers, meaning the key name itself was unrecognized. That shortcut definition is dropped.","triggerScenarios":"map ctrl+a>ctrl+k sequence where one segment has an invalid key, e.g. 'ctrl+a>ctrl+baad', or a key name kitty does not recognize in that position.","commonSituations":"Typos in key names; keys only available with specific keyboard layouts; mixing sequence separator '>' incorrectly.","solutions":["Correct the key name in the sequence segment to a kitty-recognized key (e.g. a, f1, space).","Simplify to test each segment as a single shortcut first.","Check kitty docs for key names."],"exampleFix":"# before\nmap ctrl+a>ctrl+k close_window\n\n# after\nmap ctrl+a>ctrl+w close_window","handlingStrategy":"validation","validationCode":"from kitty.key_encoding import parse_shortcut\ndef sequence_segments_ok(sc: str) -> bool:\n    for part in sc.split('>'):\n        try:\n            mods, native, key = parse_shortcut(part)\n            if key == 0:\n                return False\n        except Exception:\n            return False\n    return True","typeGuard":"def is_valid_shortcut_sequence(sc: str) -> bool:\n    return all(parse_ok(p) and key_nonzero(p) for p in sc.split('>'))","tryCatchPattern":null,"preventionTips":["Test each segment standalone as a single map before combining","Use kitty's documented key names"],"tags":["kitty","config","keybinding","shortcut"],"backgroundTag":"keybinding-parse-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}