{"record":{"id":"d469d1fdb7f6f022","repo":"kovidgoyal/kitty","slug":"must-have-codepoints-and-font-name","errorCode":null,"errorMessage":"must have codepoints AND font name","messagePattern":"must have codepoints AND font name","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":1220,"sourceCode":"        raise ValueError(f'Invalid paste actions: {q - s}, ignoring')\n    return q\n\n\ndef action_alias(val: str) -> Iterable[tuple[str, str]]:\n    parts = val.split(maxsplit=1)\n    if len(parts) > 1:\n        alias_name, rest = parts\n        yield alias_name, rest\n\n\nkitten_alias = action_alias\n\n\ndef symbol_map_parser(val: str, min_size: int = 2) -> Iterable[tuple[tuple[int, int], str]]:\n    parts = val.split()\n\n    if len(parts) < min_size:\n        raise ValueError('must have codepoints AND font name')\n    family = ' '.join(parts[1:])\n\n    def to_chr(x: str) -> int:\n        if not x.startswith('U+'):\n            raise ValueError(f'{x} is not a unicode codepoint of the form U+number')\n        return int(x[2:], 16)\n\n    for x in parts[0].split(','):\n        a_, b_ = x.replace('–', '-').partition('-')[::2]\n        b_ = b_ or a_\n        a, b = map(to_chr, (a_, b_))\n        if b < a or max(a, b) > sys.maxunicode or min(a, b) < 1:\n            raise ValueError(f'Invalid range: {a:x} - {b:x}')\n        yield (a, b), family\n\n\ndef symbol_map(val: str) -> Iterable[tuple[tuple[int, int], str]]:\n    yield from symbol_map_parser(val)","sourceCodeStart":1202,"sourceCodeEnd":1238,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1202-L1238","documentation":"symbol_map parser requires at least min_size (default 2) whitespace-separated parts: codepoint spec(s) plus a font family name. With fewer parts it cannot form a mapping and raises.","triggerScenarios":"A symbol_map line with only codepoints and no font name, e.g. 'symbol_map U+E0A0' or an empty value.","commonSituations":"Truncated config line, missing font argument when editing kitty.conf, or wrong min_size when calling symbol_map_parser programmatically.","solutions":["Append the symbol font family after the codepoints","Verify the whole symbol_map line wasn't cut off"],"exampleFix":"# before\nsymbol_map U+E0A0-U+E0A2\n# after\nsymbol_map U+E0A0-U+E0A2 Nerd Font","handlingStrategy":"validation","validationCode":"def valid_symbol_map(v: str) -> bool:\n    return len(v.split()) >= 2","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include font family after codepoints"],"tags":["kitty","config","symbol-map","fonts"],"backgroundTag":"missing-required-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}