commit | e4a07d18913077aaf31c2dbb811e957a063708d2 | [log] [tgz] |
---|---|---|
author | Keith Rarick <kr@xph.us> | Tue May 24 12:08:10 2011 -0700 |
committer | Keith Rarick <kr@xph.us> | Tue May 24 12:08:10 2011 -0700 |
tree | 89c4f37633269bec0cd1eb6d2f07ee3ecfdedfc8 | |
parent | 12319125d6d8717699f61482087006d251f930c8 [diff] |
document that darwin is broken
Pty is a Go package for using unix pseudo-terminals.
(Note, the Darwin implementation doesn‘t work. If you are interested in fixing it, I’d appreciate a patch!)
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) }