commit | b0f19ff1ae2faa49f3be9c0f304009b2cde03b97 | [log] [tgz] |
---|---|---|
author | mattn <mattn.jp@gmail.com> | Tue Sep 29 01:26:39 2020 |
committer | GitHub <noreply@github.com> | Tue Sep 29 01:26:39 2020 |
tree | a1e2cfa435ef06668b37a01b107d00ec2558872d | |
parent | acb06aaba0f8d0c278f7602374dc49e8ef8546b5 [diff] | |
parent | 5c5bbf10c75aa0d29ed1b821a4d3cbae94ff8357 [diff] |
Merge pull request #38 from zetamatta/fork20200922 Fix: the unicode from U+2000 to U+2FFF could not be gotten
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)