commit | 411b3baef308176706b2638eaec41c416e093341 | [log] [tgz] |
---|---|---|
author | Keith Rarick <kr@xph.us> | Mon Aug 15 14:43:39 2011 -0700 |
committer | Keith Rarick <kr@xph.us> | Mon Aug 15 14:43:39 2011 -0700 |
tree | c1d2fba2f8767ac462d23c009c827af1e251215c | |
parent | 227762de521220439e12273211db1f7b5d90cd79 [diff] |
simply remove the broken darwin implementation
Pty is a Go package for using unix pseudo-terminals.
(Note, there is only a Linux implementation. I'd appreciate a patch for other systems!)
goinstall github.com/kr/pty
package main import ( "fmt" "github.com/kr/pty" "io" "os" ) func main() { c, err := pty.Run( "/bin/grep", []string{"grep", "--color=auto", "bar"}, nil, "", ) if err != nil { panic(err) } go func() { fmt.Fprintln(c.Stdin, "foo") fmt.Fprintln(c.Stdin, "bar") fmt.Fprintln(c.Stdin, "baz") c.Stdin.Close() }() io.Copy(os.Stdout, c.Stdout) c.Wait(0) }