ts: github.com/olekukonko/ts Index | Examples | Files

package ts

import "github.com/olekukonko/ts"

This module is a Terminal API for the Go Programming Language. The protocols were written in pure Go and works on windows and unix systems



Package Files

doc.go ts.go ts_linux.go ts_x.go


const (
    TIOCGWINSZ = 0x5413

type Size Uses

type Size struct {
    // contains filtered or unexported fields

Return System Size

func GetSize Uses

func GetSize() (ws Size, err error)

Get Windows Size


size, _ := 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

func (Size) Col Uses

func (w Size) Col() int

Get Terminal Width

func (Size) PosX Uses

func (w Size) PosX() int

Get Position X

func (Size) PosY Uses

func (w Size) PosY() int

Get Position Y

func (Size) Row Uses

func (w Size) Row() int

Get Terminal Height

Package ts imports 2 packages (graph) and is imported by 20 packages. Updated 2017-10-18. Refresh now. Tools for package owners.