{"record":{"id":"4d92e315d7d87ffd","repo":"kovidgoyal/kitty","slug":"the-value-val-is-not-a-valid-choice-for-tab-swit","errorCode":null,"errorMessage":"The value {val} is not a valid choice for tab_switch_strategy","messagePattern":"The value (.+?) is not a valid choice for tab_switch_strategy","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/parse.py","lineNumber":1431,"sourceCode":"\n    def tab_fade(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_fade'] = tab_fade(val)\n\n    def tab_powerline_style(self, val: str, ans: dict[str, typing.Any]) -> None:\n        val = val.lower()\n        if val not in self.choices_for_tab_powerline_style:\n            raise ValueError(f\"The value {val} is not a valid choice for tab_powerline_style\")\n        ans[\"tab_powerline_style\"] = val\n\n    choices_for_tab_powerline_style = frozenset(('angled', 'round', 'slanted'))\n\n    def tab_separator(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_separator'] = tab_separator(val)\n\n    def tab_switch_strategy(self, val: str, ans: dict[str, typing.Any]) -> None:\n        val = val.lower()\n        if val not in self.choices_for_tab_switch_strategy:\n            raise ValueError(f\"The value {val} is not a valid choice for tab_switch_strategy\")\n        ans[\"tab_switch_strategy\"] = val\n\n    choices_for_tab_switch_strategy = frozenset(('last', 'left', 'previous', 'right'))\n\n    def tab_title_max_length(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_title_max_length'] = positive_int(val)\n\n    def tab_title_max_lines(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_title_max_lines'] = positive_int(val)\n\n    def tab_title_template(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_title_template'] = tab_title_template(val)\n\n    def tab_title_wrap(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_title_wrap'] = tab_title_wrap(val)\n\n    def term(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['term'] = str(val)","sourceCodeStart":1413,"sourceCodeEnd":1449,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/parse.py#L1413-L1449","documentation":"tab_switch_strategy defines how kitty picks the next tab when switching and must be one of last, left, previous, right. The parser lowercases and validates the value against a frozenset.","triggerScenarios":"Setting `tab_switch_strategy previous` works, but values like `tab_switch_strategy rightmost`, `order`, or `recent` raise this error. Also triggered by remote-control option sets with bad strings.","commonSituations":"Expecting MRU-style names like 'recent' or 'mru'; typos; configs shared across kitty versions where strategy names changed.","solutions":["Use one of: last, left, previous, right","Spell-check the value; it must be a single lowercase keyword","For 'most recently used' behavior use 'last'"],"exampleFix":"# before\ntab_switch_strategy recent\n# after\ntab_switch_strategy last","handlingStrategy":"validation","validationCode":"value = value.lower()\nif value not in ('last','left','previous','right'):\n    raise SystemExit(f'bad tab_switch_strategy: {value}')","typeGuard":"def is_tab_switch_strategy(v: str) -> bool:\n    return v.lower() in ('last','left','previous','right')","tryCatchPattern":null,"preventionTips":["'last' is the MRU-like behavior; don't guess 'recent'","Validate generated configs programmatically"],"tags":["kitty","config","validation","tabs"],"backgroundTag":"config-invalid-choice","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}