wait for sigint delivery

This commit is contained in:
Alan Donovan 2021-09-10 10:08:54 -04:00
parent 219a22ef12
commit 4f6cab195a

View file

@ -109,6 +109,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
}