kovidgoyal/kitty · warning
Too few arguments to remote_control_script function
Error message
Too few arguments to remote_control_script function
What it means
remote_control_script parsed to zero arguments; like remote_control, the action ends up with an empty argument list and does nothing.
Source
Thrown at kitty/options/utils.py:358
r = list(shlex_split(rest))
if len(r) < 1:
log_error('Too few arguments to set_colors function')
return func, r
@func_with_args('remote_control')
def remote_control(func: str, rest: str) -> FuncArgsType:
func, args = shlex_parse(func, rest)
if len(args) < 1:
log_error('Too few arguments to remote_control function')
return func, args
@func_with_args('remote_control_script')
def remote_control_script(func: str, rest: str) -> FuncArgsType:
func, args = shlex_parse(func, rest)
if len(args) < 1:
log_error('Too few arguments to remote_control_script function')
return func, args
@func_with_args('nth_os_window', 'nth_window', 'visual_window_select_action_trigger', 'next_layout')
def single_integer_arg(func: str, rest: str) -> FuncArgsType:
try:
num = int(rest)
except Exception:
if rest:
log_error(f'Invalid number for {func}: {rest}')
num = 1
return func, [num]
@func_with_args('scroll_to_prompt')
def scroll_to_prompt(func: str, rest: str) -> FuncArgsType:
vals = rest.strip().split()
args = [-1, 0]View on GitHub (pinned to 6d5d0c4406)
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
Example fix
# before map f1 remote_control_script # after map f1 remote_control_script ~/.config/kitty/rc-script.sh
Defensive patterns
Strategy: validation
Validate before calling
import shlex
ok = len(shlex.split('~/.config/kitty/rc.sh arg1')) >= 1 Prevention
- Always include the script path in remote_control_script
- Verify the script exists and is executable
When it happens
Trigger: `map f1 remote_control_script` with no script/argument string after shlex_parse.
Common situations: Forgetting the script path or pass-through arguments in the map line.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Too few arguments to remote_control function
- Passwords are not allowed to start with hyphens, ignoring th
- Cannot use forward_remote_control=yes without share_connecti
- Unknown signal: {rest} ignoring
- Invalid change_font_size specification: {rest}, treating it
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/554bc2355671aecb.
Report an issue: GitHub.