d32ff9b429
We use package github.com/olekukonko/ts to issue IOCTL's to gather the terminal size of the calling terminal in order to determine the length of lines we attempt to print. Until now, we have used revision ecf753e7c962, which is over 4 years old. Since then, github.com/olekukonko/ts has introduced support for Solaris, which we previously could not build or run on because package syscall on Solaris does not export an IOCTL constant. Let's upgrade to the latest version, and bring in support for Solaris. |
||
---|---|---|
.. | ||
.travis.yml | ||
doc.go | ||
LICENCE | ||
README.md | ||
ts_darwin.go | ||
ts_linux.go | ||
ts_other.go | ||
ts_solaris.go | ||
ts_unix.go | ||
ts_windows.go | ||
ts_x.go | ||
ts.go |
ts (Terminal Size)
Simple go Application to get Terminal Size. So Many Implementations do not support windows but ts
has full windows support.
Run go get github.com/olekukonko/ts
to download and install
Example
package main
import (
"fmt"
"github.com/olekukonko/ts"
)
func main() {
size, _ := ts.GetSize()
fmt.Println(size.Col()) // Get Width
fmt.Println(size.Row()) // Get Height
fmt.Println(size.PosX()) // Get X position
fmt.Println(size.PosY()) // Get Y position
}