{"record":{"id":"daa1e1abf20fab0f","repo":"kovidgoyal/kitty","slug":"ignoring-invalid-modify-font-with-unknown-modifica","errorCode":null,"errorMessage":"Ignoring invalid modify_font with unknown modification type: {parts[pos]}","messagePattern":"Ignoring invalid modify_font with unknown modification type: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":1096,"sourceCode":"    if parts[0]:\n        features = []\n        for feat in parts[1:]:\n            try:\n                features.append(defines.ParsedFontFeature(feat))\n            except ValueError:\n                log_error(f'Ignoring invalid font feature: {feat}')\n        yield parts[0], tuple(features)\n\n\ndef modify_font(val: str) -> Iterable[tuple[str, FontModification]]:\n    parts = val.split()\n    pos, plen = 0, len(parts)\n    if plen < 2:\n        log_error(f'Ignoring invalid modify_font: {val}')\n        return\n    mtype: ModificationType | None = getattr(ModificationType, parts[pos], None)\n    if mtype is None:\n        log_error(f'Ignoring invalid modify_font with unknown modification type: {parts[pos]}')\n        return\n    pos += 1\n    font_name = ''\n    if mtype is ModificationType.size:\n        font_name = parts[pos]\n        pos += 1\n    if plen - pos < 1:\n        log_error(f'Ignoring invalid modify_font: {val}')\n        return\n    sz = parts[pos]\n    pos += 1\n    munit = ModificationUnit.pt\n    if sz.endswith('%'):\n        munit = ModificationUnit.percent\n        sz = sz[:-1]\n    elif sz.endswith('px'):\n        munit = ModificationUnit.pixel\n        sz = sz[:-2]","sourceCodeStart":1078,"sourceCodeEnd":1114,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1078-L1114","documentation":"The first token of modify_font must be a valid ModificationType attribute (size, cell_height, cell_width, baseline, etc.). getattr lookup failed, so the directive is ignored.","triggerScenarios":"modify_font with a misspelled or unsupported type, e.g. 'modify_font height 5' (should be cell_height) or 'modify_font weight bold'.","commonSituations":"Version differences where newer modification types are unavailable in older kitty; guessing type names instead of checking docs.","solutions":["Use a valid modification type: size, cell_height, cell_width, baseline (per your kitty version's docs).","Correct typos like 'heights' -> 'height' types.","Upgrade kitty if the type only exists in newer versions."],"exampleFix":"# before\nmodify_font height +2\n\n# after\nmodify_font cell_height +2px","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"from kitty.font import ModificationType\ndef is_modification_type(tok: str) -> bool:\n    return getattr(ModificationType, tok, None) is not None","tryCatchPattern":null,"preventionTips":["Check kitty docs for the exact ModificationType names for your version","Avoid guessing names like 'height'; use cell_height"],"tags":["kitty","config","font","modify-font"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}