Skip to content

Commit

Permalink
Stop forwarding SIGINT to child processes
Browse files Browse the repository at this point in the history
Since we handle os.Interrupt but no longer forward it to child
processes, this commit also removes platform-specific handling for
Windows, preferring to use child.Process.Kill() in all cases.

Fixes #307.
  • Loading branch information
gibfahn committed Jun 6, 2022
1 parent 294c839 commit 22c287a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"os/signal"
"path/filepath"
"regexp"
"runtime"
"sort"
"strings"
"sync"
Expand Down Expand Up @@ -438,9 +437,9 @@ func runBazel(bazel string, args []string, out io.Writer) (int, error) {
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
s := <-c
if runtime.GOOS != "windows" {
cmd.Process.Signal(s)
} else {

// Only forward SIGTERM to our child process.
if s != os.Interrupt {
cmd.Process.Kill()
}
}()
Expand Down

0 comments on commit 22c287a

Please sign in to comment.