From 8820a1eeab2bd99249c6c310eebe3eb782bfc67c Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Tue, 26 May 2026 12:01:55 -0700 Subject: [PATCH] Faster exit for the browse action. --- borgmatic/actions/browse/app.py | 8 ++++++++ borgmatic/actions/browse/panels.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/borgmatic/actions/browse/app.py b/borgmatic/actions/browse/app.py index 30035f9c..2d0e6f4a 100644 --- a/borgmatic/actions/browse/app.py +++ b/borgmatic/actions/browse/app.py @@ -1,3 +1,5 @@ +import signal + import textual.app import textual.binding import textual.widgets @@ -75,3 +77,9 @@ class Browse_app(textual.app.App): ''' logs_panel = self.query_one('#logs') logs_panel.styles.display = 'none' if logs_panel.styles.display == 'block' else 'block' + + def exit(self): + # Encourages a fast exit by triggering the signal handler in borgmatic/signals.py. + signal.raise_signal(signal.SIGTERM) + + super().exit() diff --git a/borgmatic/actions/browse/panels.py b/borgmatic/actions/browse/panels.py index 3e97939e..c45e252e 100644 --- a/borgmatic/actions/browse/panels.py +++ b/borgmatic/actions/browse/panels.py @@ -137,7 +137,7 @@ def add_archive_path( ): archive_path_components = get_relative_archive_path_components(archive_path, directory_list.path_components) - if archive_path_components is None: + if not archive_path_components: return # If the option is already in the list, bail.