kovidgoyal/kitty · error · ValueError

The value {val} is not a valid choice for window_title_bar_a

Error message

The value {val} is not a valid choice for window_title_bar_align

What it means

window_title_bar_align aligns text in the window title bar and accepts left, center, right. The parser lowercases and validates; anything else aborts parsing.

Source

Thrown at kitty/options/parse.py:1585

    def window_title_bar(self, val: str, ans: dict[str, typing.Any]) -> None:
        val = val.lower()
        if val not in self.choices_for_window_title_bar:
            raise ValueError(f"The value {val} is not a valid choice for window_title_bar")
        ans["window_title_bar"] = val

    choices_for_window_title_bar = frozenset(('top', 'bottom'))

    def window_title_bar_active_background(self, val: str, ans: dict[str, typing.Any]) -> None:
        ans['window_title_bar_active_background'] = to_color_or_none(val)

    def window_title_bar_active_foreground(self, val: str, ans: dict[str, typing.Any]) -> None:
        ans['window_title_bar_active_foreground'] = to_color_or_none(val)

    def window_title_bar_align(self, val: str, ans: dict[str, typing.Any]) -> None:
        val = val.lower()
        if val not in self.choices_for_window_title_bar_align:
            raise ValueError(f"The value {val} is not a valid choice for window_title_bar_align")
        ans["window_title_bar_align"] = val

    choices_for_window_title_bar_align = frozenset(('left', 'center', 'right'))

    def window_title_bar_inactive_background(self, val: str, ans: dict[str, typing.Any]) -> None:
        ans['window_title_bar_inactive_background'] = to_color_or_none(val)

    def window_title_bar_inactive_foreground(self, val: str, ans: dict[str, typing.Any]) -> None:
        ans['window_title_bar_inactive_foreground'] = to_color_or_none(val)

    def window_title_bar_min_windows(self, val: str, ans: dict[str, typing.Any]) -> None:
        ans['window_title_bar_min_windows'] = positive_int(val)

    def window_title_template(self, val: str, ans: dict[str, typing.Any]) -> None:
        ans['window_title_template'] = tab_title_template(val)

    def x11_hide_window_decorations(self, val: str, ans: dict[str, typing.Any]) -> None:
        deprecated_hide_window_decorations_aliases('x11_hide_window_decorations', val, ans)

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Use one of: left, center, right
  2. Note this option does not accept start/end, unlike tab_bar_align
  3. Fix typos

Example fix

# before
window_title_bar_align middle
# after
window_title_bar_align center
Defensive patterns

Strategy: validation

Validate before calling

value = value.lower()
if value not in ('left','center','right'):
    raise SystemExit(f'bad window_title_bar_align: {value}')

Type guard

def is_window_title_bar_align(v: str) -> bool:
    return v.lower() in ('left','center','right')

Prevention

When it happens

Trigger: Setting `window_title_bar_align start`, `middle`, or `justify` in kitty.conf.

Common situations: Using logical alignment names (start/end) that are valid for tab_bar_align but not this option; 'middle' instead of 'center'; typos.

Related errors


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