kovidgoyal/kitty · error · ValueError

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

Error message

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

What it means

window_logo_position places the background logo and reuses the placement strategy set (choices_for_placement_strategy: e.g. top-left, center, bottom-right, etc.). The parser lowercases and validates; anything not a recognized placement keyword raises this error.

Source

Thrown at kitty/options/parse.py:1548

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

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

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

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

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

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

    choices_for_window_logo_position = choices_for_placement_strategy

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

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

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

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

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

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Use standard corner/edge names in vertical-horizontal order: e.g. top-left, top, center, bottom-right
  2. Use 'center' not 'middle'
  3. If unsure of the exact list, check choices_for_placement_strategy in kitty/options/parse.py or the docs for placement strategies

Example fix

# before
window_logo_position left-top
# after
window_logo_position top-left
Defensive patterns

Strategy: validation

Validate before calling

from kitty.options.parse import choices_for_placement_strategy
value = value.lower()
if value not in choices_for_placement_strategy:
    raise SystemExit(f'bad window_logo_position: {value}')

Type guard

def is_window_logo_position(v: str, valid: frozenset[str]) -> bool:
    return v.lower() in valid

Prevention

When it happens

Trigger: Setting `window_logo_position top-left-corner`, `middle`, or an inverted order like `left-top` in kitty.conf while window_logo_path is set.

Common situations: Inverting the corner order (left-top instead of top-left); using 'middle' instead of 'center'; copy-paste from other tools' gravity syntax (CSS/ImageMagick).

Related errors


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