{"record":{"id":"7178cdea39ba79c9","repo":"kovidgoyal/kitty","slug":"percentage-adjustments-of-key-must-be-positive-n","errorCode":null,"errorMessage":"Percentage adjustments of {key} must be positive numbers","messagePattern":"Percentage adjustments of (.+?) must be positive numbers","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":1916,"sourceCode":"    def abort(msg: str) -> None:\n        log_error(f'Send text: {val} is invalid ({msg}), ignoring')\n\n    if len(parts) < 3:\n        return abort('Incomplete')\n    mode, sc = parts[:2]\n    text = ' '.join(parts[2:])\n    key_str = f'{sc} send_text {mode} {text}'\n    for k in parse_map(key_str):\n        ans['map'].append(k)\n\n\ndef deprecated_adjust_line_height(key: str, x: str, opts_dict: dict[str, Any]) -> None:\n    fm = {'adjust_line_height': 'cell_height', 'adjust_baseline': 'baseline', 'adjust_column_width': 'cell_width'}[key]\n    mtype = getattr(ModificationType, fm)\n    if x.endswith('%'):\n        ans = float(x[:-1].strip())\n        if ans < 0:\n            log_error(f'Percentage adjustments of {key} must be positive numbers')\n            return\n        opts_dict['modify_font'][fm] = FontModification(mtype, ModificationValue(ans, ModificationUnit.percent))\n    else:\n        opts_dict['modify_font'][fm] = FontModification(mtype, ModificationValue(int(x), ModificationUnit.pixel))\n\n\ndef deprecated_scrollback_indicator_opacity(key: str, val: str, ans: dict[str, Any]) -> None:\n    if not hasattr(deprecated_scrollback_indicator_opacity, key):\n        setattr(deprecated_scrollback_indicator_opacity, key, True)\n        log_error(f'The option {key} is deprecated. Use scrollbar instead.')\n    op = unit_float(val)\n    if op <= 0.001:\n        ans['scrollbar'] = 'never'\n    else:\n        ans['scrollbar_handle_opacity'] = op\n","sourceCodeStart":1898,"sourceCodeEnd":1932,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L1898-L1932","documentation":"Legacy adjust_line_height/adjust_baseline/adjust_column_width with a percentage value must be a positive number; negative percentages log this and are ignored (non-percentage values are treated as pixel ints).","triggerScenarios":"'adjust_line_height -10%' in kitty.conf.","commonSituations":"Attempting to shrink cells with a negative percentage, which kitty forbids in the legacy option (modify_font percent also expects positive).","solutions":["Use a positive percentage or switch to modify_font with pixel values for shrinking: modify_font cell_height -2px (legacy adjust_* pixel path accepts int).","Prefer modern: modify_font cell_height +10% and modify_font cell_height -2px as needed.","Remove the negative percent value."],"exampleFix":"# before\nadjust_line_height -10%\n\n# after\nmodify_font cell_height 90%","handlingStrategy":"validation","validationCode":"def valid_adjust_percent(x: str) -> bool:\n    if x.endswith('%'):\n        try:\n            return float(x[:-1].strip()) >= 0\n        except ValueError:\n            return False\n    return True","typeGuard":"def is_nonneg_percent(x: str) -> bool:\n    if not x.endswith('%'):\n        return True\n    core = x[:-1].strip()\n    try:\n        return float(core) >= 0\n    except ValueError:\n        return False","tryCatchPattern":null,"preventionTips":["Use positive percentages or pixel offsets","Migrate to modify_font for finer control"],"tags":["kitty","config","font","deprecation"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}