pepa65 / ts

Simple go Application to get Terminal Size

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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/pepa65/ts to download and install.

Example

package main

import (
	"fmt"
	"github.com/pepa65/ts"
)

func main() {
	term, _ := ts.GetSize()
	fmt.Printf("ColxRow: %dx%d  X,Y: %d,%d\n", term.W, term.H, term.X, term.Y)
}

Issues

Getting the current position (.X and .Y) does not seem to work, at least on Linux.

Documentation

Original Documentation

  • Changes: instead of calling .Col(), .Row(), .PosX() and .PosY() just access the members of the Size struct: .W, .H, .X and .Y

About

Simple go Application to get Terminal Size

License:MIT License


Languages

Language:Go 100.0%