diff --git a/core/step.go b/core/step.go index 1de9469..fa089f1 100644 --- a/core/step.go +++ b/core/step.go @@ -156,7 +156,10 @@ func (r *Runner) RunCommands(commands []string, std string) string { var out string if std != "" { if strings.Contains(std, "/dev/pts") { - err = utils.RunOSCommandStream(command, std) + if err := utils.RunOSCommandStream(command, std); err != nil { + utils.DebugF("error running command: %v -- %v", command, err) + } + return } out, err = utils.RunOSCommand(command) } else { diff --git a/utils/helper.go b/utils/helper.go index 98b1c6d..c1f34c2 100644 --- a/utils/helper.go +++ b/utils/helper.go @@ -557,9 +557,9 @@ func RunOSCommandStream(cmd, std string) error { "-c", cmd, } - fmt.Println(std) file, _ := os.OpenFile(std, os.O_WRONLY, os.ModeAppend) realCmd := exec.Command(command[0], command[1:]...) + // realCmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} // output command output to std too realCmd.Stdout = file