Skip to content

Commit

Permalink
fix: capture signals
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsm-dev committed Jun 17, 2022
1 parent 3b8582c commit f48cad4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/trace/signals.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/muesli/termenv"
)

// catchInterrupt exits gracefully upon receiving a SIGINT (^C)
func catchInterrupt(s *spinner.Spinner) {
sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT)
Expand All @@ -20,6 +19,7 @@ func catchInterrupt(s *spinner.Spinner) {
s.FinalMSG = color.GreenString("👋 Bye!\n")
s.Stop()
}

termenv.ShowCursor()
os.Exit(0)
}

0 comments on commit f48cad4

Please sign in to comment.