mirror of https://github.com/xSmurf/oz.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
brl
ea2034fc45
|
10 years ago | |
---|---|---|
.. | ||
.gitignore | 10 years ago | |
License | 10 years ago | |
README.md | 10 years ago | |
doc.go | 10 years ago | |
ioctl.go | 10 years ago | |
ioctl_bsd.go | 10 years ago | |
mktypes.bash | 10 years ago | |
pty_darwin.go | 10 years ago | |
pty_freebsd.go | 10 years ago | |
pty_linux.go | 10 years ago | |
pty_unsupported.go | 10 years ago | |
run.go | 10 years ago | |
types.go | 10 years ago | |
types_freebsd.go | 10 years ago | |
util.go | 10 years ago | |
ztypes_386.go | 10 years ago | |
ztypes_amd64.go | 10 years ago | |
ztypes_arm.go | 10 years ago | |
ztypes_arm64.go | 10 years ago | |
ztypes_freebsd_386.go | 10 years ago | |
ztypes_freebsd_amd64.go | 10 years ago | |
ztypes_freebsd_arm.go | 10 years ago | |
ztypes_ppc64.go | 10 years ago | |
ztypes_ppc64le.go | 10 years ago | |
ztypes_s390x.go | 10 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)
}