commit | 46d423f13f53d57d999dd402426e6db88d6db043 | [log] [tgz] |
---|---|---|
author | Yohei Ueda <yohei@jp.ibm.com> | Fri Nov 21 06:50:51 2014 +0000 |
committer | Yohei Ueda <yohei@jp.ibm.com> | Fri Nov 21 10:59:21 2014 +0000 |
tree | e075a1b7e067c45aa56d5c7e53e11498b1f323e2 | |
parent | 67e2db24c831afa6c64fc17b4a143390674365ef [diff] |
Add support for Power (ppc64, ppc64le) and System z (s390x) Signed-off-by: Yohei Ueda <yohei@jp.ibm.com>
Pty is a Go package for using unix pseudo-terminals.
go get github.com/kr/pty
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) }