feat(notifications): notify when long commands finish, with duration and exit status #37

Merged
BlackAngelTV merged 4 commits from feat/cmd-finish-notifications into main 2026-11-12 07:24:20 +01:00
Showing only changes of commit 3791cdc024 - Show all commits
+2 -2
View File
@@ -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}')