diff --git a/cmd/util.go b/cmd/util.go index 61902796..ed9f0e71 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -8,6 +8,7 @@ import ( "os/exec" "runtime" "strings" + "syscall" "github.com/fatih/color" "github.com/knqyf263/pet/config" @@ -26,7 +27,8 @@ func run(command string, r io.Reader, w io.Writer) error { line := append(config.Conf.General.Cmd, command) cmd = exec.Command(line[0], line[1:]...) } else if runtime.GOOS == "windows" { - cmd = exec.Command("cmd", "/c", command) + cmd = exec.Command("cmd.exe") + cmd.SysProcAttr = &syscall.SysProcAttr{CmdLine: fmt.Sprintf("/c \"%s\"", command)} } else { cmd = exec.Command("sh", "-c", command) }