mirror of https://github.com/Hilbis/Hilbish
fix: handle sigterm and remove obsolete code
parent
0b07b93de2
commit
392cb66382
|
@ -10,20 +10,13 @@ import (
|
|||
|
||||
func handleSignals() {
|
||||
c := make(chan os.Signal)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGWINCH, syscall.SIGUSR1, syscall.SIGUSR2, syscall.SIGQUIT)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM, syscall.SIGWINCH, syscall.SIGUSR1, syscall.SIGUSR2, syscall.SIGQUIT)
|
||||
|
||||
for s := range c {
|
||||
switch s {
|
||||
case os.Interrupt:
|
||||
hooks.Em.Emit("signal.sigint")
|
||||
if !running && interactive {
|
||||
lr.ClearInput()
|
||||
}
|
||||
case syscall.SIGWINCH:
|
||||
hooks.Em.Emit("signal.resize")
|
||||
if !running && interactive {
|
||||
lr.Resize()
|
||||
}
|
||||
case os.Interrupt: hooks.Em.Emit("signal.sigint")
|
||||
case syscall.SIGTERM: exit(0)
|
||||
case syscall.SIGWINCH: hooks.Em.Emit("signal.resize")
|
||||
case syscall.SIGUSR1: hooks.Em.Emit("signal.sigusr1")
|
||||
case syscall.SIGUSR2: hooks.Em.Emit("signal.sigusr2")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue