• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..08-Aug-2017-

.gitignoreH A D08-Aug-201727 54

LicenseH A D08-Aug-20171 KiB2420

README.mdH A D08-Aug-2017469 3728

doc.goH A D08-Aug-2017349 179

ioctl.goH A D08-Aug-2017174 129

ioctl_bsd.goH A D08-Aug-20171.1 KiB4028

mktypes.bashH A D08-Aug-2017311 2014

pty_darwin.goH A D08-Aug-20171 KiB6149

pty_freebsd.goH A D08-Aug-20171.4 KiB7463

pty_linux.goH A D08-Aug-2017866 4738

pty_unsupported.goH A D08-Aug-2017146 127

run.goH A D08-Aug-2017546 2923

types.goH A D08-Aug-201783 116

types_freebsd.goH A D08-Aug-2017210 166

util.goH A D08-Aug-2017625 3629

ztypes_386.goH A D08-Aug-2017118 105

ztypes_amd64.goH A D08-Aug-2017118 105

ztypes_arm.goH A D08-Aug-2017118 105

ztypes_arm64.goH A D08-Aug-2017135 125

ztypes_freebsd_386.goH A D08-Aug-2017171 148

ztypes_freebsd_amd64.goH A D08-Aug-2017202 159

ztypes_freebsd_arm.goH A D08-Aug-2017171 148

ztypes_freebsd_arm64.goH A D03-May-2022183 148

ztypes_ppc64.goH A D08-Aug-2017135 125

ztypes_ppc64le.goH A D08-Aug-2017137 125

ztypes_s390x.goH A D08-Aug-2017135 125

README.md

1# pty
2
3Pty is a Go package for using unix pseudo-terminals.
4
5## Install
6
7    go get github.com/kr/pty
8
9## Example
10
11```go
12package main
13
14import (
15	"github.com/kr/pty"
16	"io"
17	"os"
18	"os/exec"
19)
20
21func main() {
22	c := exec.Command("grep", "--color=auto", "bar")
23	f, err := pty.Start(c)
24	if err != nil {
25		panic(err)
26	}
27
28	go func() {
29		f.Write([]byte("foo\n"))
30		f.Write([]byte("bar\n"))
31		f.Write([]byte("baz\n"))
32		f.Write([]byte{4}) // EOT
33	}()
34	io.Copy(os.Stdout, f)
35}
36```
37