{"record":{"id":"192055e4cdcfcb33","repo":"kovidgoyal/kitty","slug":"unknown-notify-on-cmd-finish-value-parts-0","errorCode":null,"errorMessage":"Unknown notify_on_cmd_finish value: {parts[0]}","messagePattern":"Unknown notify_on_cmd_finish value: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/options/utils.py","lineNumber":920,"sourceCode":"\n\nClearOn = Literal['next', 'focus']\ndefault_clear_on: tuple[ClearOn, ...] = 'focus', 'next'\nall_clear_on = get_args(ClearOn)\n\n\nclass NotifyOnCmdFinish(NamedTuple):\n    when: str = 'never'\n    duration: float = 5.0\n    action: str = 'notify'\n    cmdline: tuple[str, ...] = ()\n    clear_on: tuple[ClearOn, ...] = default_clear_on\n\n\ndef notify_on_cmd_finish(x: str) -> NotifyOnCmdFinish:\n    parts = x.split(maxsplit=3)\n    if parts[0] not in ('never', 'unfocused', 'invisible', 'always'):\n        raise ValueError(f'Unknown notify_on_cmd_finish value: {parts[0]}')\n    when = parts[0]\n    duration = 5.0\n    if len(parts) > 1:\n        duration = float(parts[1])\n    action = 'notify'\n    cmdline: tuple[str, ...] = ()\n    clear_on = default_clear_on\n    if len(parts) > 2:\n        if parts[2] not in ('notify', 'bell', 'notify-bell', 'command'):\n            raise ValueError(f'Unknown notify_on_cmd_finish action: {parts[2]}')\n        action = parts[2]\n        if action.startswith('notify'):\n            if len(parts) > 3:\n                con: list[ClearOn] = []\n                for x in parts[3].split():\n                    if x not in all_clear_on:\n                        raise ValueError(f'notify_on_cmd_finish: notify clear_on value \"{x}\" is invalid. Valid values are: {\", \".join(all_clear_on)}')\n                    con.append(cast(ClearOn, x))","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L902-L938","documentation":"notify_on_cmd_finish raises this when the first token is not one of never, unfocused, invisible, always. This token controls when a command-finish notification fires.","triggerScenarios":"notify_on_cmd_finish off, notify_on_cmd_finish focus in kitty.conf; also when the value line is empty of a valid first word.","commonSituations":"Using terminology from shell integrations or other terminals ('on', 'disable'), typos like 'allways'.","solutions":["Use never, unfocused, invisible, or always as the first word","Restore default: notify_on_cmd_finish never"],"exampleFix":"# before\nnotify_on_cmd_finish off\n# after\nnotify_on_cmd_finish unfocused","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def is_notify_when(x: str) -> bool:\n    return x in ('never','unfocused','invisible','always')","tryCatchPattern":null,"preventionTips":["First token must be one of the four documented values"],"tags":["kitty","config","notifications"],"backgroundTag":"config-value-validation-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}