Inquirer.js icon indicating copy to clipboard operation
Inquirer.js copied to clipboard

Feature Request: double backspace with no value should prompt to go back a question

Open balupton opened this issue 7 years ago • 4 comments

For https://github.com/bevry/boundation we have more than a dozen questions that the user has to fill out. If they've made a mistake with a question, then they have to ctrl+c and start again. It would be nice if a double backspace on a question, prompted the user to redo the previous question.

balupton avatar Nov 23 '18 03:11 balupton

@balupton I think this can be fix in user land. How about prompting at the end of the questions if they'd like to edit any answer? Then just show all answers in a list/checkbox prompt and make them select those they wish to edit.

I don't think that's something Inquirer should handle in the core library.

SBoudrias avatar Nov 24 '18 07:11 SBoudrias

Is there a way to abandon the current flow? As the "finish then start again from" won't work for my use case, as the questions after depend on the questions prior.

Sent with GitHawk

balupton avatar Nov 24 '18 10:11 balupton

Nothing prevents you from using prior answers to decide what/how to handle the next prompts. You can use the answers passed to most callbacks, or you can just split your prompts in 2 pieces (or more.) At the end of the day, this is just JavaScript, just use the language.

SBoudrias avatar Nov 24 '18 12:11 SBoudrias

How did you fix that problem?

gokaybiz avatar Jul 31 '19 16:07 gokaybiz