-
-
Notifications
You must be signed in to change notification settings - Fork 22
Description
In my app, I override the ctrl+c signal handling so that I can do a bunch of custom cleanup.
When the signal is not overridden, and iocraft is rendering, and ctrl+c is pressed, the entire process just exists. Which is ideal.
However when the signal is overridden and ctrl+c is pressed, iocraft will simply stop rendering but the process will continue. This means that invalid data/state is constantly pushed through, and there's no way to exit the actual process (especially if there's multiple form inputs in a row).
How best to handle this? After looking at the docs, there's no way to listen to ctrl+c within components? No way to force a std::process::exit.
My only idea, which I haven't tried yet, is to create a custom component that hooks into my custom signal handling and reacts upon it. Not sure this is 100% possible with the provided hooks, but will report back.