Commit f7ee69f3 authored by Jonathan Boulle's avatar Jonathan Boulle
Browse files

run: don't override supplied SysProcAttr

If we're passed an exec.Cmd that already has a configured SysProcAttr,
Start was obliterating it by overwriting it with a new struct in order
to set `Setctty` and `Setsid`. Instead, just adjust the parameters that
we need.
parent 5cf931ef
......@@ -18,7 +18,11 @@ func Start(c *exec.Cmd) (pty *os.File, err error) {
c.Stdout = tty
c.Stdin = tty
c.Stderr = tty
c.SysProcAttr = &syscall.SysProcAttr{Setctty: true, Setsid: true}
if c.SysProcAttr == nil {
c.SysProcAttr = &syscall.SysProcAttr{}
c.SysProcAttr.Setctty = true
c.SysProcAttr.Setsid = true
err = c.Start()
if err != nil {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment