diff --git a/cecli/tui/worker.py b/cecli/tui/worker.py index b09cb54d3c7..259ca0775eb 100644 --- a/cecli/tui/worker.py +++ b/cecli/tui/worker.py @@ -79,6 +79,8 @@ def _cleanup_loop(self): ) except RuntimeError: pass # Loop already stopped + except KeyboardInterrupt: + pass # Loop already stopped self.loop.close() except Exception: @@ -186,6 +188,11 @@ def stop(self): # We'll just pass to allow the thread to exit gracefully # without a scary traceback. pass + except KeyboardInterrupt: + # An interrupt was not caught within the async run loop. + # We'll just pass to allow the thread to exit gracefully + # without a scary traceback. + pass self.interrupt() # Wait for thread to finish