Merge pull request #138 from github/sigint-delay
Wait forever for SIGINT delivery
This commit is contained in:
commit
2fe71e3576
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue