{"record":{"id":"ac52b4baaa175470","repo":"kovidgoyal/kitty","slug":"cubic-bezier-easing-function-must-have-four-points","errorCode":null,"errorMessage":"cubic-bezier easing function must have four points","messagePattern":"cubic-bezier easing function must have four points","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":1658,"sourceCode":"    jump_type: JumpTypes = 'end'\n\n    linear_x: tuple[float, ...] = ()\n    linear_y: tuple[float, ...] = ()\n\n    cubic_bezier_points: tuple[float, ...] = ()\n\n    def __repr__(self) -> str:\n        fields = ', '.join(f'{f}={getattr(self, f)!r}' for f in self._fields if getattr(self, f) != self._field_defaults[f])\n        return f'kitty.options.utils.EasingFunction({fields})'\n\n    def __bool__(self) -> bool:\n        return bool(self.type)\n\n    @classmethod\n    def cubic_bezier(cls, params: str) -> 'EasingFunction':\n        parts = params.replace(',', ' ').split()\n        if len(parts) != 4:\n            raise ValueError('cubic-bezier easing function must have four points')\n        return cls(type='cubic-bezier', cubic_bezier_points=(unit_float(parts[0]), float(parts[1]), unit_float(parts[2]), float(parts[3])))\n\n    @classmethod\n    def linear(cls, params: str) -> 'EasingFunction':\n        parts = params.split(',')\n        if len(parts) < 2:\n            raise ValueError('Must specify at least two points for the linear easing function')\n        xaxis: list[float] = []\n        yaxis: list[float] = []\n\n        def balance(end: float) -> None:\n            extra = len(yaxis) - len(xaxis)\n            if extra <= 0:\n                return\n            start = xaxis[-1] if xaxis else 0.0\n            delta = (end - start) / max(1, extra - 1)\n            if delta <= 0.0:\n                raise ValueError(f'Linear easing curve must have strictly increasing points: {params} does not')","sourceCodeStart":1640,"sourceCodeEnd":1676,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1640-L1676","documentation":"EasingFunction.cubic_bezier requires exactly four numeric parameters (x1,y1,x2,y2) for the bezier curve; after normalizing commas to spaces it must split into exactly 4 tokens.","triggerScenarios":"A cursor_blink_interval or animation spec like 'cubic-bezier(0.42, 0)' (2 points) or 5 points; extra tokens also fail.","commonSituations":"Hand-writing CSS-like easing in kitty config and omitting a coordinate; copying truncated CSS examples.","solutions":["Supply exactly four numbers: cubic-bezier(x1, y1, x2, y2)","Prefer named easings (ease, ease-in-out) which kitty expands for you"],"exampleFix":"# before\ncursor_blink_interval 0.5:cubic-bezier(0.42, 0)\n# after\ncursor_blink_interval 0.5:cubic-bezier(0.42, 0, 1, 1)","handlingStrategy":"validation","validationCode":"def valid_cubic_bezier(params: str) -> bool:\n    return len(params.replace(',', ' ').split()) == 4","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always give 4 numbers; prefer named easings"],"tags":["kitty","config","animation","easing"],"backgroundTag":"invalid-function-arguments","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}