It would be nice to be able to use ctrl+c to flush the command-line, and re-print the prompt.
The SIGINT (or windows equivalent) can be handled using tokio::signal::ctrl_c. However, this override the signal handler, which should not be done by the library, especially for cases where ctrl+c is not to be used to flush the buffer.
For this reason, signal handling should (in my opinion) be done on the application side, and not by tokiocli.
The way I see it, this could be achieved by having a cancellable getaction, either via an optional parameter, global cli configuration, or an alternate way of calling getaction, which would add this behavior.
This can be implemented in tokiocli via select! macro and `tokio_util::sync::CancellationToken, or by ensuring that get_action is cancellation safe.
The flush mechanism should be kept separate, or at the very least opt-in too.
Splitting the mechanism that pause inputs from the one that empty the internal buffer would also allow one to retrigger a print of the whole line, in case the calling application wants to, e.g. print some log, then restore the line, so the user can resume typing.
I can implement that functionality, but I'd like to know if you have any issue/preferences regarding this, or any input on how to better handle the whole buffer flushing/re-drawing.