{"record":{"id":"37877319d331664e","repo":"kovidgoyal/kitty","slug":"invalid-neighbor-specification-rest","errorCode":null,"errorMessage":"Invalid neighbor specification: {rest}","messagePattern":"Invalid neighbor specification: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":289,"sourceCode":"    return func, [rest]\n\n\n@func_with_args('paste')\ndef paste_parse(func: str, rest: str) -> FuncArgsType:\n    text = ''\n    try:\n        text = defines.expand_ansi_c_escapes(rest)\n    except Exception:\n        log_error('Ignoring invalid paste string: ' + rest)\n    return func, [text]\n\n\n@func_with_args('neighboring_window')\ndef neighboring_window(func: str, rest: str) -> FuncArgsType:\n    rest = rest.lower()\n    rest = {'up': 'top', 'down': 'bottom'}.get(rest, rest)\n    if rest not in ('left', 'right', 'top', 'bottom'):\n        log_error(f'Invalid neighbor specification: {rest}')\n        rest = 'right'\n    return func, [rest]\n\n\n@func_with_args('resize_window')\ndef resize_window(func: str, rest: str) -> FuncArgsType:\n    vals = rest.strip().split(maxsplit=1)\n    if len(vals) > 2:\n        log_error('resize_window needs one or two arguments, using defaults')\n        args = ['wider', 1]\n    else:\n        quality = vals[0].lower()\n        if quality not in ('reset', 'taller', 'shorter', 'wider', 'narrower'):\n            log_error(f'Invalid quality specification: {quality}')\n            quality = 'wider'\n        increment = 1\n        if len(vals) == 2:\n            try:","sourceCodeStart":271,"sourceCodeEnd":307,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L271-L307","documentation":"The neighboring_window action received a direction that isn't left/right/top/bottom (after mapping up->top, down->bottom). kitty falls back to 'right'.","triggerScenarios":"`map f1 neighboring_window up-left` or any token outside the four valid directions; also plain typos like 'rigth'.","commonSituations":"Assuming diagonal or other directions exist; misspelling a direction in kitty.conf.","solutions":["Use one of: left, right, top, bottom (up/down are accepted aliases)","Fix typos in the direction argument"],"exampleFix":"# before\nmap f1 neighboring_window up-left\n# after\nmap f1 neighboring_window up","handlingStrategy":"validation","validationCode":"d = 'up'\nalias = {'up':'top','down':'bottom'}.get(d, d)\nok = alias in ('left','right','top','bottom')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict directions to left/right/top/bottom (up/down aliases)","Avoid diagonal or compound directions"],"tags":["kitty","config","window-navigation","parser"],"backgroundTag":"invalid-config-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}