all repos — honk @ 3b4797ac7d409418a87debbce6c97295656dad0d

my fork of honk

catch sigint and restore term
Ted Unangst tedu@tedunangst.com
Sun, 10 Nov 2019 20:20:56 -0500
commit

3b4797ac7d409418a87debbce6c97295656dad0d

parent

740b5902f7d16f969be2f64c069afb6f2513762b

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M admin.goadmin.go

@@ -25,6 +25,7 @@ "fmt"

"io/ioutil" "log" "os" + "os/signal" ) func adminscreen() {

@@ -98,6 +99,13 @@ stdout.Flush()

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)