I'm trying to replicate a shell environment. The following code runs within os.StartProcess
and p.Wait()
. It is able to receive C-z
(SIGTSTP) and C-c
(SIGINT) but not when I send SIGCONT
from another shell with kill -CONT [PID]
.
sigChild := make(chan os.Signal)
defer close(sigChild)
signal.Notify(sigChild, syscall.SIGTSTP, syscall.SIGINT, syscall.SIGCONT)
defer signal.Stop(sigChild)
sigRcvd := <- sigChild
fmt.Println(sigRcvd)
I'm not sure if I missing something in my code.