Debian Codegraph @

/

debian golang-github-mattn-go-tty 0.0.7-1debian golang-github-mattn-go-tty-dev gomod github.com/mattn/go-tty debiangogoinimakefilemarkdownshellyaml 23 files · 137 symbols
View dependency graph

Depends on

README (full)

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)

dir _example/
dir debian/
dir ttyutil/
file .travis.yml
file LICENSE
file README.md
file go.mod
file go.sum
file tty.go
file tty_bsd.go
file tty_linux.go
file tty_plan9.go
file tty_solaris.go
file tty_unix.go
file tty_windows.go