kovidgoyal/kitty · warning

Invalid tab_bar_margin_height: {x}, ignoring

Error message

Invalid tab_bar_margin_height: {x}, ignoring

What it means

tab_bar_margin_height expects exactly two whitespace-separated positive numbers (vertical horizontal). When the value does not split into exactly 2 parts, kitty logs this warning and falls back to TabBarMarginHeight() (zero margins).

Source

Thrown at kitty/options/utils.py:1047

    if x == 'right':
        return 0b01
    if to_bool(x):
        return 0b11
    return 0


class TabBarMarginHeight(NamedTuple):
    outer: float = 0
    inner: float = 0

    def __bool__(self) -> bool:
        return (self.outer + self.inner) > 0


def tab_bar_margin_height(x: str) -> TabBarMarginHeight:
    parts = x.split(maxsplit=1)
    if len(parts) != 2:
        log_error(f'Invalid tab_bar_margin_height: {x}, ignoring')
        return TabBarMarginHeight()
    ans = map(positive_float, parts)
    return TabBarMarginHeight(next(ans), next(ans))


def clone_source_strategies(x: str) -> frozenset[str]:
    return frozenset({'venv', 'conda', 'path', 'env_var'} & set(x.lower().split(',')))


def clear_all_mouse_actions(val: str, dict_with_parse_results: dict[str, Any] | None = None) -> bool:
    ans = to_bool(val)
    if ans and dict_with_parse_results is not None:
        dict_with_parse_results['mouse_map'] = [None]
    return ans


def clear_all_shortcuts(val: str, dict_with_parse_results: dict[str, Any] | None = None) -> bool:
    ans = to_bool(val)

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Provide exactly two positive floats: tab_bar_margin_height <vertical> <horizontal>.
  2. Example: tab_bar_margin_height 10 5
  3. Avoid units and negative values.

Example fix

# before
tab_bar_margin_height 10

# after
tab_bar_margin_height 10 5
Defensive patterns

Strategy: validation

Validate before calling

def valid_tbmh(x: str) -> bool:
    parts = x.split()
    return len(parts) == 2 and all(p.replace('.','',1).isdigit() and float(p) > 0 for p in parts)

Type guard

def is_two_positive_floats(x: str) -> bool:
    p = x.split()
    return len(p) == 2 and all(float(t) > 0 for t in p if t.lstrip('-').replace('.','',1).isdigit()) and len(p) == 2

Prevention

When it happens

Trigger: tab_bar_margin_height with 0, 1, or 3+ tokens, e.g. 'tab_bar_margin_height 10' or 'tab_bar_margin_height 10 5 2', or a non-numeric token which will also fail positive_float.

Common situations: Assuming the option takes a single number like other margin options; copy-pasting multi-line values; using 'none' or units like '10px'.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/bc8cba64f6d53cbb. Report an issue: GitHub.