Fix CTRL-Z handling: Signal SIGSTOP to PGID

Fix #3501
pull/3504/head
Junegunn Choi 7 months ago
parent 68db9cb499
commit 70c19ccf16
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -7,6 +7,8 @@ import (
"os/signal"
"strings"
"syscall"
"golang.org/x/sys/unix"
)
func notifyOnResize(resizeChan chan<- os.Signal) {
@ -14,7 +16,12 @@ func notifyOnResize(resizeChan chan<- os.Signal) {
}
func notifyStop(p *os.Process) {
p.Signal(syscall.SIGSTOP)
pid := p.Pid
pgid, err := unix.Getpgid(pid)
if err == nil {
pid = pgid * -1
}
unix.Kill(pid, syscall.SIGSTOP)
}
func notifyOnCont(resizeChan chan<- os.Signal) {

Loading…
Cancel
Save