Skip to content

Commit

Permalink
continue responding to signals after initial sigint
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoohey31 committed Dec 16, 2023
1 parent d8b7df8 commit cb0b1dd
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@ func newApp(ui *ui, nav *nav) *app {
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)
go func() {
switch <-sigChan {
case os.Interrupt:
return
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
app.quit()
os.Exit(3)
return
for {
switch <-sigChan {
case os.Interrupt:
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
app.quit()
os.Exit(3)
return
}
}
}()

Expand Down

0 comments on commit cb0b1dd

Please sign in to comment.