From e0b84aaff7ed7676692ab2e678de7b9ff3566a00 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 26 Jan 2022 15:18:09 -0400 Subject: [PATCH] feat: emit sigusr1 and 2 signal hooks --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ee629d0..548b85c 100644 --- a/main.go +++ b/main.go @@ -260,7 +260,7 @@ func fmtPrompt() string { func handleSignals() { c := make(chan os.Signal) - signal.Notify(c, os.Interrupt, syscall.SIGWINCH) + signal.Notify(c, os.Interrupt, syscall.SIGWINCH, syscall.SIGUSR1, syscall.SIGUSR2) for s := range c { switch s { @@ -274,6 +274,8 @@ func handleSignals() { if !running && interactive { lr.Resize() } + case syscall.SIGUSR1: hooks.Em.Emit("signals.sigusr1") + case syscall.SIGUSR2: hooks.Em.Emit("signals.sigusr2") } } }