AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.08k stars 351 forks source link

Ctrl-C skips validation and does not exit the program #264

Closed EnigmaCurry closed 4 years ago

EnigmaCurry commented 4 years ago

I expected that if I press Ctrl-C while survey is asking me a question, it would stop and quit the program. However, right now it just skips the question, even if the question has a required validator, and the program keeps running, skipping past the survey.

sagikazarmark commented 4 years ago

This is a duplicate: https://github.com/AlecAivazis/survey/issues?q=is%3Aissue+ctrl-c+is%3Aclosed

@AlecAivazis I really think you should mention this in the README 😄

tl;dr handle interrupt error: https://github.com/AlecAivazis/survey/blob/89dab5040dc4cf726ba34725f18b0e32ad9608aa/terminal/error.go#L8

AlecAivazis commented 4 years ago

Yea its clearly confusing a number of people. If you wanted to open a PR that adds it @sagikazarmark, i would happily review it. Otherwise, I will try to get something in soon, although i am currently on vacation so it might take a bit

sagikazarmark commented 4 years ago

See #265