Skip to content

Process exit on ctrl+c instead of stopping rendering #148

@milesj

Description

@milesj

@ccbrown

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionQuestions about the library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions