kovidgoyal/kitty · warning

Invalid move_window specification: {rest}

Error message

Invalid move_window specification: {rest}

What it means

The move_window argument is neither an integer (window number) nor one of left/right/top/bottom; kitty falls back to 0 (move to window 0 / no-op depending on layout).

Source

Thrown at kitty/options/utils.py:324

        if len(vals) == 2:
            try:
                increment = int(vals[1])
            except Exception:
                log_error(f'Invalid increment specification: {vals[1]}')
        args = [quality, increment]
    return func, args


@func_with_args('move_window')
def move_window(func: str, rest: str) -> FuncArgsType:
    rest = rest.lower()
    rest = {'up': 'top', 'down': 'bottom'}.get(rest, rest)
    prest: int | str = rest
    try:
        prest = int(prest)
    except Exception:
        if prest not in ('left', 'right', 'top', 'bottom'):
            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')

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Use an integer window number or one of: left, right, top, bottom (up/down are aliases)
  2. Fix typos in the argument

Example fix

# before
map f1 move_window diag
# after
map f1 move_window left
Defensive patterns

Strategy: validation

Validate before calling

arg = 'left'
try:
    int(arg); ok = True
except ValueError:
    ok = arg in ('left','right','top','bottom')

Prevention

When it happens

Trigger: `map f1 move_window diagonal` — int() fails and the string isn't a valid direction.

Common situations: Expecting direction names beyond the four sides, or typos in a numeric target.

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/91a9404540ba8f48. Report an issue: GitHub.