func (t *TtyConsole) attach(command *execdriver.Command, pipes *execdriver.Pipes) error { command.Stdout = t.slave command.Stderr = t.slave command.Console = t.slave.Name() go func() { if wb, ok := pipes.Stdout.(interface { CloseWriters() error }); ok { defer wb.CloseWriters() } io.Copy(pipes.Stdout, t.master) }() if pipes.Stdin != nil { command.Stdin = t.slave command.SysProcAttr.Setctty = true go func() { defer pipes.Stdin.Close() io.Copy(t.master, pipes.Stdin) }() } return nil }