Ignore SIGINT when running as proxy

This commit is contained in:
Junegunn Choi 2024-05-22 20:01:37 +09:00
parent 7205203dc8
commit 552158f3ad
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -7,6 +7,7 @@ import (
"io"
"os"
"os/exec"
"os/signal"
"path/filepath"
"strings"
"time"
@ -102,6 +103,7 @@ func runProxy(commandPrefix string, cmdBuilder func(temp string) *exec.Cmd, opts
defer os.Remove(temp)
cmd := cmdBuilder(temp)
signal.Ignore(os.Interrupt)
if err := cmd.Run(); err != nil {
if exitError, ok := err.(*exec.ExitError); ok {
code := exitError.ExitCode()