feat: emit sigusr1 and 2 signal hooks

windows-fixes
TorchedSammy 2022-01-26 15:18:09 -04:00
parent 8821171ff5
commit e0b84aaff7
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 3 additions and 1 deletions

View File

@ -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")
}
}
}