kovidgoyal/kitty · warning

Too few arguments to set_colors function

Error message

Too few arguments to set_colors function

What it means

set_colors got zero arguments after shell-splitting; kitty logs but returns the empty list, making the action a no-op.

Source

Thrown at kitty/options/utils.py:342

            log_error(f'Invalid move_window specification: {rest}')
            prest = 0
    return func, [prest]


@func_with_args('pipe')
def pipe(func: str, rest: str) -> FuncArgsType:
    r = list(shlex_split(rest))
    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

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Pass a theme name or color config file, e.g. `map f1 set_colors My Dark` or `map f1 set_colors None` to reset to defaults
  2. Ensure the argument isn't empty after quoting

Example fix

# before
map f1 set_colors
# after
map f1 set_colors Catppuccin-Mocha
Defensive patterns

Strategy: validation

Validate before calling

import shlex
ok = len(shlex.split('Catppuccin-Mocha')) >= 1

Prevention

When it happens

Trigger: `map f1 set_colors` with no argument, or an argument consisting only of whitespace/quotes that shlex splits into nothing.

Common situations: Forgetting the theme file or 'None' argument; quoting mistakes that swallow the value.

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


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/1bb00e5237afb05c. Report an issue: GitHub.