{"record":{"id":"c25f33f1c1a109ed","repo":"kovidgoyal/kitty","slug":"the-value-val-is-not-a-valid-choice-for-strip-tr","errorCode":null,"errorMessage":"The value {val} is not a valid choice for strip_trailing_spaces","messagePattern":"The value (.+?) is not a valid choice for strip_trailing_spaces","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/parse.py","lineNumber":1359,"sourceCode":"    def shell_integration(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['shell_integration'] = shell_integration(val)\n\n    def show_hyperlink_targets(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['show_hyperlink_targets'] = show_hyperlink_targets(val)\n\n    def single_window_margin_width(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['single_window_margin_width'] = optional_edge_width(val)\n\n    def single_window_padding_width(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['single_window_padding_width'] = optional_edge_width(val)\n\n    def startup_session(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['startup_session'] = config_or_absolute_path(val)\n\n    def strip_trailing_spaces(self, val: str, ans: dict[str, typing.Any]) -> None:\n        val = val.lower()\n        if val not in self.choices_for_strip_trailing_spaces:\n            raise ValueError(f\"The value {val} is not a valid choice for strip_trailing_spaces\")\n        ans[\"strip_trailing_spaces\"] = val\n\n    choices_for_strip_trailing_spaces = frozenset(('always', 'never', 'smart'))\n\n    def symbol_map(self, val: str, ans: dict[str, typing.Any]) -> None:\n        for k, v in symbol_map(val):\n            ans[\"symbol_map\"][k] = v\n\n    def sync_to_monitor(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['sync_to_monitor'] = to_bool(val)\n\n    def tab_activity_symbol(self, val: str, ans: dict[str, typing.Any]) -> None:\n        ans['tab_activity_symbol'] = tab_activity_symbol(val)\n\n    def tab_bar_align(self, val: str, ans: dict[str, typing.Any]) -> None:\n        val = val.lower()\n        if val not in self.choices_for_tab_bar_align:\n            raise ValueError(f\"The value {val} is not a valid choice for tab_bar_align\")","sourceCodeStart":1341,"sourceCodeEnd":1377,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/parse.py#L1341-L1377","documentation":"strip_trailing_spaces in kitty.conf must be one of always, never, or smart. The parser lowercases and validates against a frozenset; anything else aborts option parsing with this ValueError.","triggerScenarios":"Setting `strip_trailing_spaces yes`, `strip_trailing_spaces true`, or `strip_trailing_spaces Smart ` (typo) in kitty.conf. Note booleans are not accepted — only the three keywords.","commonSituations":"Users familiar with kitty's other boolean options (which take yes/no) assuming this one is boolean too; older kitty versions accepted only smart/never and new values confuse migrations.","solutions":["Replace the value with always, never, or smart","Do not use yes/no/true/false for this option","Check the option docs if unsure which keyword your kitty version supports"],"exampleFix":"# before\nstrip_trailing_spaces yes\n# after\nstrip_trailing_spaces smart","handlingStrategy":"validation","validationCode":"value = value.lower()\nif value not in ('always','never','smart'):\n    raise SystemExit(f'bad strip_trailing_spaces: {value}')","typeGuard":"def is_strip_trailing_spaces(v: str) -> bool:\n    return v.lower() in ('always','never','smart')","tryCatchPattern":null,"preventionTips":["Remember this option is keyword-based, not boolean","Use --debug-config after editing kitty.conf"],"tags":["kitty","config","validation","whitespace"],"backgroundTag":"config-invalid-choice","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}