diff --git a/admin.go b/admin.go index bcfb7a0..3c391b0 100644 --- a/admin.go +++ b/admin.go @@ -25,6 +25,7 @@ import ( "io/ioutil" "log" "os" + "os/signal" ) func adminscreen() { @@ -98,6 +99,13 @@ func adminscreen() { C.tcsetattr(1, C.TCSAFLUSH, savedtio) } defer restore() + go func() { + sig := make(chan os.Signal) + signal.Notify(sig, os.Interrupt) + <-sig + restore() + os.Exit(0) + }() init := func() { tio := new(C.struct_termios)