kovidgoyal/kitty · error · ValueError

{r} has too many points for a linear easing curve parameter

Error message

{r} has too many points for a linear easing curve parameter

What it means

Each comma-separated parameter of a linear() easing can hold at most 3 space-separated numbers (x plus up to 2 y candidates); more than 3 points in one parameter is rejected.

Source

Thrown at kitty/options/utils.py:1704

                yaxis.append(y)
            else:
                x = unit_float(x)
                balance(x)
                xaxis.append(x)
                yaxis.append(y)

        for r in parts:
            points = r.strip().split()
            y = unit_float(points[0])
            if len(points) == 1:
                add_point(y)
            elif len(points) == 2:
                add_point(y, percent(points[1]))
            elif len(points) == 3:
                add_point(y, percent(points[1]))
                add_point(y, percent(points[2]))
            else:
                raise ValueError(f'{r} has too many points for a linear easing curve parameter')
        balance(1)
        return cls(type='linear', linear_x=tuple(xaxis), linear_y=tuple(yaxis))

    @classmethod
    def steps(cls, params: str) -> 'EasingFunction':
        parts = params.replace(',', ' ').split()
        jump_type: JumpTypes = 'end'
        if len(parts) == 2:
            n = int(parts[0])
            jt = parts[1]
            mapping: dict[str, JumpTypes] = {'jump-start': 'start', 'start': 'start', 'end': 'end', 'jump-end': 'end', 'jump-none': 'none', 'jump-both': 'both'}
            try:
                jump_type = mapping[jt.lower()]
            except KeyError:
                raise KeyError(f'{jt} is not a valid jump type for a linear easing function')
            if jump_type == 'none':
                n = max(2, n)
            else:

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Split into separate comma-separated parameters with at most 3 numbers each
  2. Follow kitty's linear easing syntax from the docs

Example fix

# before
cursor_blink_interval 0.5:linear(0 0.1 0.2 0.3)
# after
cursor_blink_interval 0.5:linear(0 0.1, 0.2 0.3)
Defensive patterns

Strategy: validation

Validate before calling

def valid_linear_params(params: str) -> bool:
    return all(len(p.split()) <= 3 for p in params.split(','))

Prevention

When it happens

Trigger: Something like 'linear(0 0.1 0.2 0.3, ...)' — a single segment parameter with 4 numbers.

Common situations: Misreading the syntax and packing multiple y values into one parameter instead of separating with commas.

Related errors


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