continue responding to signals after initial sigint (#1549)

This commit is contained in:
Matthew Toohey authored and GitHub committed 2023-12-16 19:26:16 +11:00
1 parent d8b7df87cb
commit 2a4adb323f
1 file changed
+8 -7
+8 -7
View File
@@ -49,13 +49,14 @@ 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() {
switch <-sigChan { for {
case os.Interrupt: switch <-sigChan {
return case os.Interrupt:
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
}
} }
}() }()