From d6bdffca10f6eafc614c327aedb792a4d910e44d Mon Sep 17 00:00:00 2001 From: BlackAngelTVdev Date: Wed, 11 Nov 2026 10:59:11 +0100 Subject: [PATCH] feat(options): notify when long commands finish by default The notification only happened if notify_on_cmd_finish was passed on the command line or written in kitty.conf, so a fresh build looked like it had no such feature at all. Long-running commands now notify by default once the window loses focus; the 5 second threshold keeps short commands silent. --- docs/changelog.rst | 5 +++++ kitty/options/definition.py | 4 +++- kitty/options/types.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index b42d1a5..6ffb633 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -222,6 +222,11 @@ Detailed list of changes 0.50.1 [unreleased] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- :opt:`notify_on_cmd_finish` is now enabled by default with the value + :code:`unfocused`: commands running longer than 5 seconds notify when the + window loses focus, without any configuration. Use :code:`never` to turn it + off. + - The :opt:`notify_on_cmd_finish` notification now reports how long the command ran, next to the command line and the exit status it already showed. A shell that ends a command without reporting a status (:code:`OSC 133;D` with no diff --git a/kitty/options/definition.py b/kitty/options/definition.py index 3467918..417f60e 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -3342,12 +3342,14 @@ first valid match, in the order specified, is sourced. opt( 'notify_on_cmd_finish', - 'never', + 'unfocused', option_type='notify_on_cmd_finish', long_text=""" Show a desktop notification when a long-running command finishes (needs :opt:`shell_integration`). The notification gives the command line, how long it ran and its exit status. +By default commands running longer than 5 seconds are reported when the window +loses focus, set the value to :code:`never` to disable this. The possible values are: :code:`never` diff --git a/kitty/options/types.py b/kitty/options/types.py index 0b19007..8bfc4d5 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -640,7 +640,7 @@ class Options: mark3_foreground: Color = Color(0, 0, 0) momentum_scroll: float = 0.96 mouse_hide_wait: MouseHideWait = MouseHideWait(hide_wait=0.0, show_wait=0.0, show_threshold=40, scroll_show=True) if is_macos else MouseHideWait(hide_wait=3.0, show_wait=0.0, show_threshold=40, scroll_show=True) - notify_on_cmd_finish: NotifyOnCmdFinish = NotifyOnCmdFinish(when='never', duration=5.0, action='notify', cmdline=(), clear_on=('focus', 'next')) + notify_on_cmd_finish: NotifyOnCmdFinish = NotifyOnCmdFinish(when='unfocused', duration=5.0, action='notify', cmdline=(), clear_on=('focus', 'next')) open_url_with: list[str] = ['default'] padding_fill_strategy: choices_for_padding_fill_strategy = 'background' palette_generate: choices_for_palette_generate = 'fixed'