commit | 53dd597300005d500d7136de51a5a2b8c3ab8f94 | [log] [tgz] |
---|---|---|
author | Guillaume J. Charmes <guillaume@charmes.net> | Fri Nov 21 10:43:19 2014 -0500 |
committer | Guillaume J. Charmes <guillaume@charmes.net> | Fri Nov 21 10:43:19 2014 -0500 |
tree | e075a1b7e067c45aa56d5c7e53e11498b1f323e2 | |
parent | 67e2db24c831afa6c64fc17b4a143390674365ef [diff] | |
parent | 46d423f13f53d57d999dd402426e6db88d6db043 [diff] |
Merge pull request #25 from yoheiueda/add-power-systemz Add support for Power (ppc64, ppc64le) and System z (s390x)
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) }