mirror of
https://github.com/yudai/gotty.git
synced 2026-01-29 12:46:11 +01:00
switched to go-mod, updated codegangsta/cli -> urfave/cli
This commit is contained in:
parent
a080c85cbc
commit
f0fe6d57fd
466 changed files with 248599 additions and 5024 deletions
35
vendor/github.com/kr/pty/README.md
generated
vendored
35
vendor/github.com/kr/pty/README.md
generated
vendored
|
|
@ -1,36 +1,9 @@
|
|||
# pty
|
||||
|
||||
Pty is a Go package for using unix pseudo-terminals.
|
||||
This Go module has moved to <https://github.com/creack/pty>.
|
||||
|
||||
## Install
|
||||
Existing clients will continue to work.
|
||||
|
||||
go get github.com/kr/pty
|
||||
New clients should use the new module import path
|
||||
`github.com/creack/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