From bb090ccc72c69a54fd87e48403377d766c8d253f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 16 Aug 2024 20:47:52 +0530 Subject: [PATCH] Fix a regression in notify_on_cmd_finish that caused notifications to appear for every command after the first Fixes #7725 --- docs/changelog.rst | 2 ++ kitty/window.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a77448c9e..303beb573 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -138,6 +138,8 @@ Detailed list of changes - macOS: Bump the minimum required macOS version to Catalina released five years ago. +- Fix a regression in :opt:`notify_on_cmd_finish` that caused notifications to appear for every command after the first (:iss:`7725`) + 0.35.2 [2024-06-22] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/window.py b/kitty/window.py index 992118dd7..e2cf564af 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -1452,13 +1452,13 @@ def manipulate_title_stack(self, pop: bool, title: str, icon: Any) -> None: def handle_cmd_end(self, exit_status: str = '') -> None: if self.last_cmd_output_start_time == 0.: return - self.last_cmd_output_start_time = 0. try: self.last_cmd_exit_status = int(exit_status) except Exception: self.last_cmd_exit_status = 0 end_time = monotonic() last_cmd_output_duration = end_time - self.last_cmd_output_start_time + self.last_cmd_output_start_time = 0. self.call_watchers(self.watchers.on_cmd_startstop, { "is_start": False, "time": end_time, 'cmdline': self.last_cmd_cmdline, 'exit_status': self.last_cmd_exit_status})