Replies: 1 comment 5 replies
-
So - I'm not sure there's any defined expectation - if only because "CTRL-C" is "copy" on most applications, not "close/exit". There's a distinction between passing CTRL-C at the terminal that was used to start an app, and passing CTRL-C that is running the app. In "normal" operation of a GUI app, you don't have access to terminal that started the app, so pressing CTRL-C isn't even possible. As you've noted, this distinction doesn't exist for console apps... in that context, we will likely need to catch CTRL-C so it can be used for a system "copy" command. That's something we'll definitely need to address when we get to adding menus/commands to the Texual backend. An explicit SIGINT/SIGTERM is another matter... I guess there's an argument to be made that those should go through "normal" exit processing. I have a mild concern about ending up with an "unclosable" app - if you mess up the definition of an My initial thought is that we should set up signal handlers so that:
However, I'm not wedded to those interpretations. In particular, switching SIGINT and SIGTERM in those interpretations might make sense. |
Beta Was this translation helpful? Give feedback.
-
I noticed today that
toga.App.on_exit
doesn't run if I press CTRL-C while the app is running; the same happens if I manually send aSIGINT
orSIGTERM
to the app. That wasn't what I would have expected to happen...so, it got me curious:Are there set expectations for how an app should exit in response to non-GUI-based exit requests?
This may be even more important with the introduction of console apps.
Beta Was this translation helpful? Give feedback.
All reactions