{"record":{"id":"66f50efcede1466c","repo":"kovidgoyal/kitty","slug":"too-few-arguments-to-remote-control-function","errorCode":null,"errorMessage":"Too few arguments to remote_control function","messagePattern":"Too few arguments to remote_control function","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":350,"sourceCode":"    if len(r) < 3:\n        log_error('Too few arguments to pipe function')\n        r = ['none', 'none', 'true']\n    return func, r\n\n\n@func_with_args('set_colors')\ndef set_colors(func: str, rest: str) -> FuncArgsType:\n    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}')","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L332-L368","documentation":"The remote_control action parsed to zero arguments after shlex parsing; kitty logs but returns the empty arg list, so the action has nothing to dispatch.","triggerScenarios":"`map f1 remote_control` with no sub-command string, or arguments that shlex_parse reduces to nothing.","commonSituations":"Forgetting the remote control command and its arguments in the map definition.","solutions":["Provide the full remote control payload, e.g. `map f1 remote_control set-colors --all foreground=red`","Verify quoting so the command line survives shlex splitting"],"exampleFix":"# before\nmap f1 remote_control\n# after\nmap f1 remote_control set-colors --all foreground=red","handlingStrategy":"validation","validationCode":"import shlex\nok = len(shlex.split('set-colors --all foreground=red')) >= 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["remote_control needs the full command string after the action","Test remote control syntax with `kitty @ ...` first"],"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"}