kovidgoyal/kitty · error · ValueError

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

Error message

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

What it means

terminfo_type controls how kitty writes terminfo entries and accepts only path, direct, or none. The parser lowercases and validates; invalid values abort config parsing.

Source

Thrown at kitty/options/parse.py:1454

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

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

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

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

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

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

    choices_for_terminfo_type = frozenset(('path', 'direct', 'none'))

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

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

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

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

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

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Use one of: path, direct, none
  2. If you want the terminfo written to a directory, that is 'path' (combined with the terminfo path option)
  3. Fix typos and remove quotes/extraneous characters

Example fix

# before
terminfo_type xterm
# after
terminfo_type direct
Defensive patterns

Strategy: validation

Validate before calling

value = value.lower()
if value not in ('path','direct','none'):
    raise SystemExit(f'bad terminfo_type: {value}')

Type guard

def is_terminfo_type(v: str) -> bool:
    return v.lower() in ('path','direct','none')

Prevention

When it happens

Trigger: Setting `terminfo_type xterm`, `terminfo_type dirs`, or a typo in kitty.conf; or passing an invalid value when generating terminfo via the kitty CLI.

Common situations: Users trying to emulate other terminals' terminfo behavior with made-up names; misspelling 'direct'; older configs from versions before this option existed being linted by newer kitty.

Related errors


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