{"record":{"id":"05d2b43d8a3cc0cc","repo":"kovidgoyal/kitty","slug":"rest-is-not-a-valid-marker-specification","errorCode":null,"errorMessage":"{rest} is not a valid marker specification","messagePattern":"(.+?) is not a valid marker specification","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":454,"sourceCode":"                raise ValueError(f'Mark group in marker specification is not an integer: {parts[i]}')\n            sspec = parts[i + 1]\n            if 'regex' not in ftype:\n                sspec = re.escape(sspec)\n            ans.append((color, sspec))\n        ftype = 'regex'\n        spec: str | tuple[tuple[int, str], ...] = tuple(ans)\n    elif ftype == 'function':\n        spec = ' '.join(parts)\n    else:\n        raise ValueError(f'Unknown marker type: {ftype}')\n    return ftype, spec, flags\n\n\n@func_with_args('toggle_marker')\ndef toggle_marker(func: str, rest: str) -> FuncArgsType:\n    parts = rest.split(maxsplit=1)\n    if len(parts) != 2:\n        raise ValueError(f'{rest} is not a valid marker specification')\n    ftype, spec = parts\n    parts = list(shlex_split(spec))\n    return func, list(parse_marker_spec(ftype, parts))\n\n\n@func_with_args('scroll_to_mark')\ndef scroll_to_mark(func: str, rest: str) -> FuncArgsType:\n    parts = rest.split()\n    if not parts or not rest:\n        return func, [True, 0]\n    if len(parts) == 1:\n        q = parts[0].lower()\n        if q in ('prev', 'previous', 'next'):\n            return func, [q != 'next', 0]\n        try:\n            return func, [True, max(0, min(int(q), 3))]\n        except Exception:\n            raise ValueError(f'{rest} is not a valid scroll_to_mark destination')","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L436-L472","documentation":"toggle_marker in kitty/options/utils.py raises this when the argument string to toggle_marker cannot be split into exactly two whitespace-separated parts (marker type and spec). It means the action was given fewer or more than the required two components.","triggerScenarios":"Mapping or remote-calling toggle_marker with a single word (map f1 toggle_marker regex) or with leading/trailing structure that yields != 2 parts after rest.split(maxsplit=1).","commonSituations":"Copy-paste of set_marker syntax into toggle_marker, forgetting the spec portion, or trailing whitespace collapse issues in kitty.conf.","solutions":["Provide both the marker type and the spec: toggle_marker <ftype> <spec>","Verify the map line in kitty.conf has the full two-part argument"],"exampleFix":"# before\nmap f1 toggle_marker regex\n# after\nmap f1 toggle_marker regex ERROR.*","handlingStrategy":"validation","validationCode":"def valid_toggle_marker_arg(rest: str) -> bool:\n    return len(rest.split(maxsplit=1)) == 2","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass '<ftype> <spec>' to toggle_marker","Lint kitty.conf map lines in CI"],"tags":["kitty","config","terminal","markers"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}