summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-05-22 22:14:00 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-05-22 22:14:00 +0900
commit303c3bae7ff02996bdbad4b743cdb23c1813a4c6 (patch)
tree4dd98fa6c4fbd113db4ff27accad8fa522d71a0e /src
parent6b4358f641cc284302da176238f7190e30fe8622 (diff)
downloadfzf-303c3bae7ff02996bdbad4b743cdb23c1813a4c6.tar.gz
proxy: Pass SIGINT to the child fzf
Diffstat (limited to 'src')
-rw-r--r--src/proxy.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/proxy.go b/src/proxy.go
index 65a56604..adeea213 100644
--- a/src/proxy.go
+++ b/src/proxy.go
@@ -103,7 +103,14 @@ func runProxy(commandPrefix string, cmdBuilder func(temp string) *exec.Cmd, opts
defer os.Remove(temp)
cmd := cmdBuilder(temp)
- signal.Ignore(os.Interrupt)
+ intChan := make(chan os.Signal, 1)
+ defer close(intChan)
+ go func() {
+ if sig, valid := <-intChan; valid {
+ cmd.Process.Signal(sig)
+ }
+ }()
+ signal.Notify(intChan, os.Interrupt)
if err := cmd.Run(); err != nil {
if exitError, ok := err.(*exec.ExitError); ok {
code := exitError.ExitCode()