remove obsolete makefile
1 file changed
tree: 01da55cec5d2a4cdf6048a6f83ba1b092f3921b2
  1. .gitignore
  2. License
  3. pty_linux.go
  4. README.md
  5. run.go
README.md

pty

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!)

Install

go get github.com/kr/pty

Example

package main

import (
	"fmt"
	"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() {
		fmt.Fprintln(f, "foo")
		fmt.Fprintln(f, "bar")
		fmt.Fprintln(f, "baz")
		f.Close()
	}()
	io.Copy(os.Stdout, f)
	c.Wait()
}