diff --git a/piker/ui/_app.py b/piker/ui/_app.py index 68ecb3dd..10c7e3d8 100644 --- a/piker/ui/_app.py +++ b/piker/ui/_app.py @@ -181,7 +181,14 @@ async def _async_main( ): # remove startup status text starting_done() - await trio.sleep_forever() + try: + await trio.sleep_forever() + except KeyboardInterrupt as _kbi: + log.cancel( + f'User canceled Qt app.\n' + f'{_kbi!r}' + ) + raise _kbi def _main( diff --git a/piker/ui/_style.py b/piker/ui/_style.py index 196d6fd8..6abe48a9 100644 --- a/piker/ui/_style.py +++ b/piker/ui/_style.py @@ -1,5 +1,5 @@ # piker: trading gear for hackers -# Copyright (C) Tyler Goodlet (in stewardship for piker0) +# Copyright (C) Tyler Goodlet (in stewardship for pikers) # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by diff --git a/piker/ui/_window.py b/piker/ui/_window.py index a15ecd24..6fb8b506 100644 --- a/piker/ui/_window.py +++ b/piker/ui/_window.py @@ -217,8 +217,14 @@ class MainWindow(QMainWindow): '''Cancel the root actor asap. ''' - # raising KBI seems to get intercepted by by Qt so just use the system. - os.kill(os.getpid(), signal.SIGINT) + # raising a KBI seems to get intercepted by Qt, soo just use OS ?? + # TODO XXX! seems to sometimes cause Qt core dumps if you + # cancel during chart bootup..? + # -[ ] find a better/more-correct cancellation API in Qt? + os.kill( + os.getpid(), + signal.SIGINT, + ) @property def status_bar(self) -> QStatusBar: