summaryrefslogtreecommitdiff
path: root/vendor/github.com/kr/pty/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/kr/pty/run.go')
-rw-r--r--vendor/github.com/kr/pty/run.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/vendor/github.com/kr/pty/run.go b/vendor/github.com/kr/pty/run.go
deleted file mode 100644
index baecca8af..000000000
--- a/vendor/github.com/kr/pty/run.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// +build !windows
-
-package pty
-
-import (
- "os"
- "os/exec"
- "syscall"
-)
-
-// Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
-// and c.Stderr, calls c.Start, and returns the File of the tty's
-// corresponding pty.
-func Start(c *exec.Cmd) (pty *os.File, err error) {
- pty, tty, err := Open()
- if err != nil {
- return nil, err
- }
- defer tty.Close()
- c.Stdout = tty
- c.Stdin = tty
- c.Stderr = tty
- if c.SysProcAttr == nil {
- c.SysProcAttr = &syscall.SysProcAttr{}
- }
- c.SysProcAttr.Setctty = true
- c.SysProcAttr.Setsid = true
- err = c.Start()
- if err != nil {
- pty.Close()
- return nil, err
- }
- return pty, err
-}