You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/vendor/github.com/mattn/go-tty
Megan Marsh 53bbce4cd7
update to newest version of go-tty to fix control flow bug
6 years ago
..
.travis.yml add go-tty vendor 7 years ago
LICENSE add go-tty vendor 7 years ago
README.md add go-tty vendor 7 years ago
tty.go fix panic: send on closed channel 7 years ago
tty_bsd.go add go-tty vendor 7 years ago
tty_linux.go add go-tty vendor 7 years ago
tty_plan9.go fix panic: send on closed channel 7 years ago
tty_unix.go update to newest version of go-tty to fix control flow bug 6 years ago
tty_windows.go fix panic: send on closed channel 7 years ago

README.md

go-tty

Simple tty utility

Usage

tty, err := tty.Open()
if err != nil {
	log.Fatal(err)
}
defer tty.Close()

for {
	r, err := tty.ReadRune()
	if err != nil {
		log.Fatal(err)
	}
	// handle key event
}

if you are on windows and want to display ANSI colors, use go-colorable.

tty, err := tty.Open()
if err != nil {
	log.Fatal(err)
}
defer tty.Close()

out := colorable.NewColorable(tty.Output())

fmt.Fprintln(out, "\x1b[2J")

Installation

$ go get github.com/mattn/go-tty

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)