Open IbexPeak opened 2 years ago
Hey, I would also love to have this feature.
I have a console app that sometimes receives requests from a server, in which case I would like to stop the current prompt question and start a new one with the request coming from the server.
Thanks for making this cool prompt, I was looking for something like this for a while and just came across this project this week.
Do you think adding support for CancellationToken would fulfill your request?
I would like to refer to the API design.
For my case I would think that would definitely work, all I want to do is to cancel the current prompt question and create a new one.
I guess this is also what @IbexPeak needs?
Thank you for your reply.
Sorry for the late reply, CancellationToken would be ok for me.
CancellationToken would be nice. Additional nice feature would be to support handilng ESC in prompts (in addition to ctrl+c).
Hi shibayan,
I currently have the problem that I can't cancel a form like an input form manually.
In my application a wpf window hosts a console, which is shown upon request and can be hidden using a button. If the user inputs text without pressing enter, but than hides the console, the next time the (cleared) console is displayed, the last form is still opened, and results in strange effects with the next inputs (inputs are combined with cached inputs). Creating a fresh console instance does not resolve the problem, as the input form is still open inside Sharprompt.
Currently the only solution is when the use enters "Ctrl" + "C" in combination with Prompt.ThrowExceptionOnCancel, which internally resets the form in Sharprompt. It would be nice if this reset can be called at any time from code for all open forms.
Thanks in advance!