mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 18:57:17 -07:00
new: asking confirmation when the session is closed with CTRL+C / SIGINT
(closes #319)
This commit is contained in:
parent
6c43fb7673
commit
924387faf2
2 changed files with 15 additions and 4 deletions
|
@ -347,9 +347,8 @@ func (s *Session) startNetMon() {
|
|||
}
|
||||
|
||||
func (s *Session) setupSignals() {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt)
|
||||
signal.Notify(c, syscall.SIGTERM)
|
||||
c := make(chan os.Signal)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
go func() {
|
||||
<-c
|
||||
fmt.Println()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue