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

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