commit | 0f3e0990b930cdb9b7aa59257f077cd95d1c431b | [log] [tgz] |
---|---|---|
author | Yasuhiro Matsumoto <[email protected]> | Sat Nov 23 13:44:39 2019 |
committer | Yasuhiro Matsumoto <[email protected]> | Sat Nov 23 13:44:39 2019 |
tree | 4eb9674ca48beb3365ecac28998d1cca4f9cebf7 | |
parent | 4a41a8313e5df6f50b3d93ffa032752f0ad12d40 [diff] |
Fix build
Simple tty utility
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")
$ go get github.com/mattn/go-tty
MIT
Yasuhiro Matsumoto (a.k.a mattn)