manifoldco / promptui

Interactive prompt for command-line applications
https://www.manifold.co
BSD 3-Clause "New" or "Revised" License
6.03k stars 333 forks source link

Reset the prompt after selection #201

Open gennaro-tedesco opened 2 years ago

gennaro-tedesco commented 2 years ago

I have a standard use case where the user is shown a promptui.Prompt and, upon validation of the query string, such string is passed onto promptui.Select to display a menu choice. Is it possible to "reset the selection" back to the initial prompt via keybinding without exiting (Ctrl-C), namely for the user to go be the search prompt to change their query? I see that keys can be overriden as per here - but I believe this does not really cover the case. Sorry if I have missed it somewhere in the documentation already and the question is trivial.

Likewise, is it possible to specify different keybinding to prompt an action after the selection (namely say that with enter the user is selecting action 1, with ctrl-v the user decides to select action2 and so forth)?