fzf/src/terminal_unix.go

29 lines
449 B
Go
Raw Permalink Normal View History

2022-03-29 12:20:33 +00:00
//go:build !windows
package fzf
import (
"os"
"os/signal"
"syscall"
"golang.org/x/sys/unix"
)
func notifyOnResize(resizeChan chan<- os.Signal) {
signal.Notify(resizeChan, syscall.SIGWINCH)
}
2017-04-28 13:58:08 +00:00
func notifyStop(p *os.Process) {
pid := p.Pid
pgid, err := unix.Getpgid(pid)
if err == nil {
pid = pgid * -1
}
unix.Kill(pid, syscall.SIGSTOP)
2017-04-28 13:58:08 +00:00
}
func notifyOnCont(resizeChan chan<- os.Signal) {
signal.Notify(resizeChan, syscall.SIGCONT)
}