cri-o/vendor/github.com/kr/pty
Jacek J. Łakis bf51655a7b vendor: Update vendoring for the exec client and server implementations
Signed-off-by: Jacek J. Łakis <jacek.lakis@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-04-24 18:38:41 +02:00
..
.gitignore vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
doc.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ioctl.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ioctl_bsd.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
License vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
mktypes.bash vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
pty_darwin.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
pty_dragonfly.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
pty_freebsd.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
pty_linux.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
pty_unsupported.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
README.md vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
run.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
types.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
types_dragonfly.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
types_freebsd.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
util.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_386.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_amd64.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_arm.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_arm64.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_dragonfly_amd64.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_freebsd_386.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_freebsd_amd64.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_freebsd_arm.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_mipsx.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_ppc64.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_ppc64le.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00
ztypes_s390x.go vendor: Update vendoring for the exec client and server implementations 2017-04-24 18:38:41 +02:00

pty

Pty is a Go package for using unix pseudo-terminals.

Install

go get github.com/kr/pty

Example

package main

import (
	"github.com/kr/pty"
	"io"
	"os"
	"os/exec"
)

func main() {
	c := exec.Command("grep", "--color=auto", "bar")
	f, err := pty.Start(c)
	if err != nil {
		panic(err)
	}

	go func() {
		f.Write([]byte("foo\n"))
		f.Write([]byte("bar\n"))
		f.Write([]byte("baz\n"))
		f.Write([]byte{4}) // EOT
	}()
	io.Copy(os.Stdout, f)
}