terminal_unix.go
This file
Path
src/terminal_unix.go
29 lines · 444 bytes · Go
Last changed by
Terminate resize notification when Loop exitsJunegunn Choibefore adoptiondc384af
History of this fileTake it
The walk stopped after 200 commits: lines older than 76efddd point at it.
bash: shift-delete to delete history entries during CTRL-RJunegunn Choibefore adoption76efddd
lines 1–5why, one step back1//go:build !windows23package fzf45import (Terminate resize notification when Loop exitsJunegunn Choibefore adoptiondc384af
line 6why, one step back6 "context"bash: shift-delete to delete history entries during CTRL-RJunegunn Choibefore adoption76efddd
lines 7–13why, one step back7 "os"8 "os/signal"9 "syscall"1011 "golang.org/x/sys/unix"12)13Terminate resize notification when Loop exitsJunegunn Choibefore adoptiondc384af
line 14why, one step back14func notifyOnResize(ctx context.Context, resizeChan chan<- os.Signal) {bash: shift-delete to delete history entries during CTRL-RJunegunn Choibefore adoption76efddd
line 15why, one step back15 signal.Notify(resizeChan, syscall.SIGWINCH)Terminate resize notification when Loop exitsJunegunn Choibefore adoptiondc384af
lines 16–19why, one step back16 go func() {17 <-ctx.Done()18 signal.Stop(resizeChan)19 }()bash: shift-delete to delete history entries during CTRL-RJunegunn Choibefore adoption76efddd
lines 20–29why, one step back20}2122func notifyStop(p *os.Process) {23 pid := p.Pid24 pgid, err := unix.Getpgid(pid)25 if err == nil {26 pid = pgid * -127 }28 unix.Kill(pid, syscall.SIGTSTP)29}