kovidgoyal/kitty · warning
Too few arguments to remote_control function
Error message
Too few arguments to remote_control function
What it means
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.
Source
Thrown at kitty/options/utils.py:350
if len(r) < 3:
log_error('Too few arguments to pipe function')
r = ['none', 'none', 'true']
return func, r
@func_with_args('set_colors')
def set_colors(func: str, rest: str) -> FuncArgsType:
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}')View on GitHub (pinned to 6d5d0c4406)
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
Example fix
# before map f1 remote_control # after map f1 remote_control set-colors --all foreground=red
Defensive patterns
Strategy: validation
Validate before calling
import shlex
ok = len(shlex.split('set-colors --all foreground=red')) >= 1 Prevention
- remote_control needs the full command string after the action
- Test remote control syntax with `kitty @ ...` first
When it happens
Trigger: `map f1 remote_control` with no sub-command string, or arguments that shlex_parse reduces to nothing.
Common situations: Forgetting the remote control command and its arguments in the map definition.
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_script 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/66f50efcede1466c.
Report an issue: GitHub.