{"record":{"id":"3fde4471d5d56039","repo":"kovidgoyal/kitty","slug":"vals-1-is-not-a-valid-scroll-offset-for-scroll","errorCode":null,"errorMessage":"{vals[1]} is not a valid scroll offset for scroll_to_prompt","messagePattern":"(.+?) is not a valid scroll offset for scroll_to_prompt","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":388,"sourceCode":"    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':\n        mult = {'s': 1, 'm': 60, 'h': 3600, 'd': 24 * 3600}[sleep_time[-1]]\n        sleep_time = sleep_time[:-1]\n    return func, [abs(float(sleep_time)) * mult]\n\n\n@func_with_args('disable_ligatures_in')\ndef disable_ligatures_in(func: str, rest: str) -> FuncArgsType:\n    parts = rest.split(maxsplit=1)\n    if len(parts) == 1:\n        where, strategy = 'active', parts[0]","sourceCodeStart":370,"sourceCodeEnd":406,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L370-L406","documentation":"The second argument to scroll_to_prompt (the scroll offset) is not an integer; kitty keeps the default 0 offset.","triggerScenarios":"`map f1 scroll_to_prompt -1 top` — int(vals[1]) raises on 'top'.","commonSituations":"Using words like 'top'/'bottom' for the offset instead of a line count.","solutions":["Use an integer line offset, e.g. `map f1 scroll_to_prompt -1 10` to land 10 lines above the prompt","Drop the second argument entirely if no offset is needed"],"exampleFix":"# before\nmap f1 scroll_to_prompt -1 top\n# after\nmap f1 scroll_to_prompt -1 10","handlingStrategy":"validation","validationCode":"ok = '10'.lstrip('+-').isdigit()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scroll offset must be an integer line count","Omit the second argument when no offset is wanted"],"tags":["kitty","config","scrollback","integer-parse"],"backgroundTag":"invalid-config-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}