repositorypackage
0.0.0-20170219200355-5c97524c8b54
Repository: https://github.com/kopoli/go-terminal-size.git
Documentation: pkg.go.dev
# README
Go terminal size
Features:
- Get the size of the current terminal as rows and columns.
- Listen on terminal size changes and receive the new size via a channel.
- Supports Linux and Windows.
Installation
$ go get github.com/kopoli/go-terminal-size
Usage
For a complete example see _example/example.go
.
Abbreviated example:
package main
import (
"fmt"
tsize "github.com/kopoli/go-terminal-size"
)
func main() {
var s tsize.Size
s, err := tsize.GetSize()
if err == nil {
fmt.Println("Current size is", s.Width, "by", s.Height)
}
}
License
MIT license