commit | 0467868096dbfab4b683e41dd7aaba1c12363233 | [log] [tgz] |
---|---|---|
author | Guillaume J. Charmes <guillaume@charmes.net> | Fri May 20 10:59:22 2016 -0500 |
committer | Guillaume J. Charmes <guillaume@charmes.net> | Fri May 20 10:59:22 2016 -0500 |
tree | fc26a677f884743a07533ccd6fa2615c83c0aecf | |
parent | f7ee69f31298ecbe5d2b349c711e2547a617d398 [diff] | |
parent | c0bea8ed3c8ff9ecb23c54be9b82ed24a3501420 [diff] |
Merge pull request #41 from mneumann/fix_dragonfly Support DragonFly BSD
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) }