{"record":{"id":"554bc2355671aecb","repo":"kovidgoyal/kitty","slug":"too-few-arguments-to-remote-control-script-functio","errorCode":null,"errorMessage":"Too few arguments to remote_control_script function","messagePattern":"Too few arguments to remote_control_script function","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":358,"sourceCode":"    r = list(shlex_split(rest))\n    if len(r) < 1:\n        log_error('Too few arguments to set_colors function')\n    return func, r\n\n\n@func_with_args('remote_control')\ndef remote_control(func: str, rest: str) -> FuncArgsType:\n    func, args = shlex_parse(func, rest)\n    if len(args) < 1:\n        log_error('Too few arguments to remote_control function')\n    return func, args\n\n\n@func_with_args('remote_control_script')\ndef remote_control_script(func: str, rest: str) -> FuncArgsType:\n    func, args = shlex_parse(func, rest)\n    if len(args) < 1:\n        log_error('Too few arguments to remote_control_script function')\n    return func, args\n\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]","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L340-L376","documentation":"remote_control_script parsed to zero arguments; like remote_control, the action ends up with an empty argument list and does nothing.","triggerScenarios":"`map f1 remote_control_script` with no script/argument string after shlex_parse.","commonSituations":"Forgetting the script path or pass-through arguments in the map line.","solutions":["Pass the script and arguments, e.g. `map f1 remote_control_script my-script.sh arg1`","Ensure the script path is correct and quoted if it contains spaces"],"exampleFix":"# before\nmap f1 remote_control_script\n# after\nmap f1 remote_control_script ~/.config/kitty/rc-script.sh","handlingStrategy":"validation","validationCode":"import shlex\nok = len(shlex.split('~/.config/kitty/rc.sh arg1')) >= 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the script path in remote_control_script","Verify the script exists and is executable"],"tags":["kitty","config","remote-control","parser"],"backgroundTag":"invalid-config-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}