mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-09-28 05:09:02 +00:00
70c19ccf16
Fix #3501
34 lines
563 B
Go
34 lines
563 B
Go
//go:build !windows
|
|
|
|
package fzf
|
|
|
|
import (
|
|
"os"
|
|
"os/signal"
|
|
"strings"
|
|
"syscall"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func notifyOnResize(resizeChan chan<- os.Signal) {
|
|
signal.Notify(resizeChan, syscall.SIGWINCH)
|
|
}
|
|
|
|
func notifyStop(p *os.Process) {
|
|
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) {
|
|
signal.Notify(resizeChan, syscall.SIGCONT)
|
|
}
|
|
|
|
func quoteEntry(entry string) string {
|
|
return "'" + strings.Replace(entry, "'", "'\\''", -1) + "'"
|
|
}
|