mirror of https://github.com/Hilbis/Hilbish
feat: emit sigusr1 and 2 signal hooks
parent
8821171ff5
commit
e0b84aaff7
4
main.go
4
main.go
|
@ -260,7 +260,7 @@ func fmtPrompt() string {
|
||||||
|
|
||||||
func handleSignals() {
|
func handleSignals() {
|
||||||
c := make(chan os.Signal)
|
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 {
|
for s := range c {
|
||||||
switch s {
|
switch s {
|
||||||
|
@ -274,6 +274,8 @@ func handleSignals() {
|
||||||
if !running && interactive {
|
if !running && interactive {
|
||||||
lr.Resize()
|
lr.Resize()
|
||||||
}
|
}
|
||||||
|
case syscall.SIGUSR1: hooks.Em.Emit("signals.sigusr1")
|
||||||
|
case syscall.SIGUSR2: hooks.Em.Emit("signals.sigusr2")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue