gotty/vendor/github.com/kr/pty
2016-04-13 16:17:57 +09:00
..
.gitignore Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
doc.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ioctl_bsd.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ioctl.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
License Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
mktypes.bash Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
pty_darwin.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
pty_freebsd.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
pty_linux.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
pty_unsupported.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
README.md Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
run.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
types_freebsd.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
types.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
util.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_386.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_amd64.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_arm64.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_arm.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_freebsd_386.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_freebsd_amd64.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_freebsd_arm.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_ppc64.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_ppc64le.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09:00
ztypes_s390x.go Change to go1.6.1 and vendoring 2016-04-13 16:17:57 +09: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)
}