Merge pull request #138 from github/sigint-delay

Wait forever for SIGINT delivery
This commit is contained in:
Alan Donovan 2021-09-10 14:15:36 -04:00 committed by GitHub
commit 2fe71e3576

View file

@ -111,6 +111,10 @@ func ask(qs []*survey.Question, response interface{}) error {
if err == terminal.InterruptErr {
self, _ := os.FindProcess(os.Getpid())
_ = self.Signal(os.Interrupt) // assumes POSIX
// Suspend the goroutine, to avoid a race between
// return from main and async delivery of INT signal.
select {}
}
return err
}