Skip to content

srlehn/go-tty

This branch is 1 commit ahead of, 47 commits behind mattn/go-tty:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

52a7a45 · Apr 19, 2019

History

70 Commits
Apr 7, 2019
Jul 29, 2017
Jun 4, 2016
Sep 7, 2018
Feb 14, 2018
Apr 1, 2019
Jun 3, 2016
Jun 3, 2016
Apr 1, 2019
Apr 18, 2019
Apr 18, 2019

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%