{"record":{"id":"0cd2eea8294348ea","repo":"kovidgoyal/kitty","slug":"scroll-to-prompt-needs-one-or-two-arguments-using","errorCode":null,"errorMessage":"scroll_to_prompt needs one or two arguments, using defaults","messagePattern":"scroll_to_prompt needs one or two arguments, using defaults","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":378,"sourceCode":"\n\n@func_with_args('nth_os_window', 'nth_window', 'visual_window_select_action_trigger', 'next_layout')\ndef single_integer_arg(func: str, rest: str) -> FuncArgsType:\n    try:\n        num = int(rest)\n    except Exception:\n        if rest:\n            log_error(f'Invalid number for {func}: {rest}')\n        num = 1\n    return func, [num]\n\n\n@func_with_args('scroll_to_prompt')\ndef scroll_to_prompt(func: str, rest: str) -> FuncArgsType:\n    vals = rest.strip().split()\n    args = [-1, 0]\n    if len(vals) > 2:\n        log_error('scroll_to_prompt needs one or two arguments, using defaults')\n    else:\n        try:\n            args[0] = int(vals[0])\n        except Exception:\n            log_error(f'{vals[0]} is not a valid number of prompts to jump for scroll_to_prompt')\n        if len(vals) == 2:\n            try:\n                args[1] = int(vals[1])\n            except Exception:\n                log_error(f'{vals[1]} is not a valid scroll offset for scroll_to_prompt')\n    return func, args\n\n\n@func_with_args('sleep')\ndef sleep(func: str, sleep_time: str) -> FuncArgsType:\n    mult = 1\n    sleep_time = sleep_time or '1'\n    if sleep_time[-1] in 'shmd':","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L360-L396","documentation":"scroll_to_prompt accepts at most two arguments (prompt count and scroll offset); more than that triggers this message and kitty keeps the defaults [-1, 0].","triggerScenarios":"`map f1 scroll_to_prompt -1 0 extra` — rest.strip().split() yields more than 2 tokens.","commonSituations":"Adding extra parameters or comments on the same map line; misunderstanding the action's arity.","solutions":["Use at most two integer arguments: scroll_to_prompt [prompt_count] [scroll_offset]","Move any trailing text off the map line"],"exampleFix":"# before\nmap f1 scroll_to_prompt -1 0 0\n# after\nmap f1 scroll_to_prompt -1 0","handlingStrategy":"validation","validationCode":"tokens = '-1 0'.split()\nok = len(tokens) <= 2","typeGuard":null,"tryCatchPattern":null,"preventionTips":["scroll_to_prompt takes at most two integers","Keep comments off map lines"],"tags":["kitty","config","scrollback","parser"],"backgroundTag":"invalid-config-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}