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

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