cri-o/vendor/github.com/kr/pty
Mrunal Patel 4128bbd7dc Bump up runtime-spec dependency to v1.0.0
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
2017-07-19 21:38:05 -07:00
..
License 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
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
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
run.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

README.md

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)
}