{"record":{"id":"be124faba09f2dab","repo":"kovidgoyal/kitty","slug":"unknown-marker-type-ftype-be124f","errorCode":null,"errorMessage":"Unknown marker type: {ftype}","messagePattern":"Unknown marker type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":446,"sourceCode":"            flags |= re.IGNORECASE\n        if not parts or len(parts) % 2 != 0:\n            raise ValueError('Mark group number and text/regex are not specified in pairs: {}'.format(' '.join(parts)))\n        ans = []\n        for i in range(0, len(parts), 2):\n            try:\n                color = max(1, min(int(parts[i]), 3))\n            except Exception:\n                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]","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L428-L464","documentation":"Raised by parse_marker_spec in kitty's option parser when the first token of a marker specification (e.g. in set_marker/toggle_marker actions) is not one of the recognized marker types: 'regex', 'text',', 'function', 'color', etc. It signals the ftype word parsed from the spec did not match any branch of the parser. The error propagates as a config/rc-action parse failure.","triggerScenarios":"Calling set_marker or toggle_marker with a spec whose first word is not a known type, e.g. map f1 set_marker regx foo or launch --type=action set_marker foo bar. Also triggered by parse of mouse_map/remote-control messages containing malformed marker specs.","commonSituations":"Typos in marker type ('regx' instead of 'regex'), older kitty versions lacking newer marker types, or hand-crafted remote-control JSON payloads with a bad ftype field.","solutions":["Correct the marker type to a supported one (regex, text, function, color)","Check kitty docs for the action (set_marker/toggle_marker) for the accepted types in your kitty version","If sending remote-control messages, validate the marker spec before sending"],"exampleFix":"# before\nmap f1 set_marker regx ERROR.*\n# after\nmap f1 set_marker regex ERROR.*","handlingStrategy":"validation","validationCode":"import re\nMARKER_TYPES = {'regex', 'text', 'function', 'color'}\ndef valid_marker_spec(spec: str) -> bool:\n    ftype = spec.split(maxsplit=1)[0].lower()\n    return ftype in MARKER_TYPES","typeGuard":null,"tryCatchPattern":"try:\n    parse_marker_spec(ftype, parts)\nexcept ValueError as e:\n    log_config_error(e); fallback_to_default_marker()","preventionTips":["Validate the first word against known marker types before building map lines","Keep marker type constants in one place and reuse them"],"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"}