The sweep/scan finally blocks call self.app.call_from_thread() to reset button state, but self.app raises NoActiveAppError if the Textual context is already torn down during Ctrl+C shutdown. Wrap with contextlib.suppress so the flag reset still happens.