Gyu-Ho Lee d03a3d141e vendor: update gRPC dependency 8 years ago
..
.gitignore b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
License b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
README.md b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
doc.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ioctl.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ioctl_bsd.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
mktypes.bash d03a3d141e vendor: update gRPC dependency 8 years ago
pty_darwin.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
pty_freebsd.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
pty_linux.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
pty_unsupported.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
run.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
types.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
types_freebsd.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
util.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_386.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_amd64.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_arm.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_arm64.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_freebsd_386.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_freebsd_amd64.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_freebsd_arm.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_ppc64.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_ppc64le.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago
ztypes_s390x.go b1d41016b2 vendor: only vendor on emitted binaries 8 years ago

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