From 3791cdc0248bb744dbe02e498b4b1176de7656d4 Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Wed, 11 Nov 2026 10:45:18 +0100 Subject: [PATCH] fix(notifications): report the parsed exit status of finished commands A shell that ends a command with a bare OSC 133;D leaves the raw status string empty, so the notification said "finished with status: ." and the command action got an empty %s. Use the status already parsed for the event instead. --- kitty/window.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/window.py b/kitty/window.py index bf0c7a3..c871206 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -2074,7 +2074,7 @@ class Window: cmd = nm.create_notification_cmd() cmd.title = 'kitty' s = self.last_cmd_cmdline.replace('\\\n', ' ') - cmd.body = f'Command {s} finished with status: {exit_status}.\nClick to focus.' + cmd.body = f'Command {s} finished with status: {self.last_cmd_exit_status}.\nClick to focus.' cmd.only_when = OnlyWhen(when) if not nm.is_notification_allowed(cmd, self.id): return @@ -2096,7 +2096,7 @@ class Window: notify(self, opts, nm) self.screen.bell() elif action == 'command': - open_cmd([x.replace('%c', self.last_cmd_cmdline).replace('%s', exit_status) for x in notify_cmdline]) + open_cmd([x.replace('%c', self.last_cmd_cmdline).replace('%s', str(self.last_cmd_exit_status)) for x in notify_cmdline]) else: raise ValueError(f'Unknown action in option `notify_on_cmd_finish`: {action}')