# go-tty **Repository Path**: mirrors_chromium_googlesource/go-tty ## Basic Information - **Project Name**: go-tty - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-19 - **Last Updated**: 2025-08-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # go-tty Simple tty utility ## Usage ```go 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. ```go 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)