manifoldco / promptui

Interactive prompt for command-line applications

Home Page:https://www.manifold.co

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset the prompt after selection

gennaro-tedesco opened this issue · comments

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)?