mirror of
https://github.com/yudai/gotty.git
synced 2026-01-28 04:06:11 +01:00
Change to go1.6.1 and vendoring
This commit is contained in:
parent
b1c5226875
commit
a350994aa2
164 changed files with 17 additions and 1383 deletions
36
Godeps/_workspace/src/github.com/kr/pty/README.md
generated
vendored
36
Godeps/_workspace/src/github.com/kr/pty/README.md
generated
vendored
|
|
@ -1,36 +0,0 @@
|
|||
# pty
|
||||
|
||||
Pty is a Go package for using unix pseudo-terminals.
|
||||
|
||||
## Install
|
||||
|
||||
go get github.com/kr/pty
|
||||
|
||||
## Example
|
||||
|
||||
```go
|
||||
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)
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue