continue responding to signals after initial sigint (#1549)
This commit is contained in:
1 parent
d8b7df87cb
commit
2a4adb323f
1 file changed
+2
-1
@@ -49,14 +49,15 @@ func newApp(ui *ui, nav *nav) *app {
|
|||||||
sigChan := make(chan os.Signal, 1)
|
sigChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(sigChan, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)
|
signal.Notify(sigChan, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
|
for {
|
||||||
switch <-sigChan {
|
switch <-sigChan {
|
||||||
case os.Interrupt:
|
case os.Interrupt:
|
||||||
return
|
|
||||||
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
|
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
|
||||||
app.quit()
|
app.quit()
|
||||||
os.Exit(3)
|
os.Exit(3)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return app
|
return app
|
||||||
|
|||||||
Reference in new issue
Block a user