Skip to content

Commit cb0b1dd

Browse files
committed
continue responding to signals after initial sigint
1 parent d8b7df8 commit cb0b1dd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

app.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ func newApp(ui *ui, nav *nav) *app {
4949
sigChan := make(chan os.Signal, 1)
5050
signal.Notify(sigChan, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)
5151
go func() {
52-
switch <-sigChan {
53-
case os.Interrupt:
54-
return
55-
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
56-
app.quit()
57-
os.Exit(3)
58-
return
52+
for {
53+
switch <-sigChan {
54+
case os.Interrupt:
55+
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
56+
app.quit()
57+
os.Exit(3)
58+
return
59+
}
5960
}
6061
}()
6162

0 commit comments

Comments
 (0)