diff --git a/runner/config.go b/runner/config.go index a5af959c..a6b8ed91 100644 --- a/runner/config.go +++ b/runner/config.go @@ -94,6 +94,7 @@ type cfgMisc struct { type cfgScreen struct { ClearOnRebuild bool `toml:"clear_on_rebuild"` KeepScroll bool `toml:"keep_scroll"` + NoPTY bool `toml:"no_pty"` } type sliceTransformer struct{} diff --git a/runner/util_linux.go b/runner/util_linux.go index 658671b3..c9b69fb3 100644 --- a/runner/util_linux.go +++ b/runner/util_linux.go @@ -30,6 +30,24 @@ func (e *Engine) killCmd(cmd *exec.Cmd) (pid int, err error) { func (e *Engine) startCmd(cmd string) (*exec.Cmd, io.ReadCloser, io.ReadCloser, error) { c := exec.Command("/bin/sh", "-c", cmd) + if e.config.Screen.NoPTY { + c.SysProcAttr = &syscall.SysProcAttr{ + Setpgid: true, + } + stderr, err := c.StderrPipe() + if err != nil { + return nil, nil, nil, err + } + stdout, err := c.StdoutPipe() + if err != nil { + return nil, nil, nil, err + } + err = c.Start() + if err != nil { + return nil, nil, nil, err + } + return c, stdout, stderr, err + } f, err := pty.Start(c) return c, f, f, err }