{"record":{"id":"5f1c43643e6ac539","repo":"kovidgoyal/kitty","slug":"unknown-action-in-option-notify-on-cmd-finish","errorCode":null,"errorMessage":"Unknown action in option `notify_on_cmd_finish`: {action}","messagePattern":"Unknown action in option `notify_on_cmd_finish`: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/window.py","lineNumber":1930,"sourceCode":"                if window.last_cmd_end_notification is not None:\n                    if 'next' in opts.notify_on_cmd_finish.clear_on:\n                        nm.close_notification(window.last_cmd_end_notification[0])\n                    window.last_cmd_end_notification = None\n                notification_id = nm.notify_with_command(cmd, window.id)\n                if notification_id is not None:\n                    window.last_cmd_end_notification = notification_id, cmd.only_when\n\n            if action == 'notify':\n                notify(self, opts, nm)\n            elif action == 'bell':\n                self.screen.bell()\n            elif action == 'notify-bell':\n                notify(self, opts, nm)\n                self.screen.bell()\n            elif action == 'command':\n                open_cmd([x.replace('%c', self.last_cmd_cmdline).replace('%s', exit_status) for x in notify_cmdline])\n            else:\n                raise ValueError(f'Unknown action in option `notify_on_cmd_finish`: {action}')\n\n    def cmd_output_marking(self, is_start: bool | None, cmdline: str = '') -> None:\n        if is_start:\n            start_time = monotonic()\n            self.last_cmd_output_start_time = start_time\n            cmdline = decode_cmdline(cmdline) if cmdline else ''\n            self.last_cmd_cmdline = cmdline\n            self.call_watchers(self.watchers.on_cmd_startstop, {'is_start': True, 'time': start_time, 'cmdline': cmdline, 'exit_status': 0})\n        else:\n            self.handle_cmd_end(cmdline)\n\n    # }}}\n\n    # mouse actions {{{\n    @ac(\n        'mouse',\n        \"\"\"\n        Handle a mouse click","sourceCodeStart":1912,"sourceCodeEnd":1948,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/window.py#L1912-L1948","documentation":"When a command finishes, kitty walks the notify_on_cmd_finish option's comma-separated actions; unrecognized tokens fall through to a ValueError naming the bad action. Valid actions include 'notify', 'notify-bell', and 'command' (the latter with a notify_cmdline configured). Anything else — including misspellings and unsupported names — is rejected.","triggerScenarios":"Setting notify_on_cmd_finish to something like 'sound' or 'bell' (not 'notify-bell'), or a stray token like 'notify,' trailing comma artifacts producing an empty/garbage action.","commonSituations":"kitty.conf typos; copying config snippets from outdated docs or other terminals (e.g. trying 'bell' from a different option); version differences where an action name was renamed or not yet available.","solutions":["Use only supported actions: notify, notify-bell, command","Check the option's docs for your kitty version (actions differ across releases)","Remove the unknown token from kitty.conf / the set-option call"],"exampleFix":"# before\nnotify_on_cmd_finish sound\n# after\nnotify_on_cmd_finish notify","handlingStrategy":"validation","validationCode":"VALID = {'notify', 'notify-bell', 'command'}\nactions = [a for a in raw.split(',') if a]\nbad = [a for a in actions if a not in VALID]\nif bad:\n    raise ValueError(f'unsupported notify actions: {bad}')","typeGuard":"def valid_notify_actions(value: str) -> bool:\n    return all(a in ('notify', 'notify-bell', 'command') for a in value.split(',') if a)","tryCatchPattern":"try:\n    opts.notify_on_cmd_finish = raw\nexcept ValueError as e:\n    if 'Unknown action' in str(e):\n        opts.notify_on_cmd_finish = 'notify'\n    else:\n        raise","preventionTips":["Validate kitty.conf values in CI with kitty +runpy or a config linter","Copy option values only from docs matching your installed kitty version"],"tags":["configuration","notify","option-validation"],"backgroundTag":"invalid-config-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}