all repos — mx @ 12fc7b4d3cf1c04ee2075775a683b7bc6227ee1f

work in progress MUA

term/utils.go (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
package term

import (
	"golang.org/x/sys/unix"
)

func GetSize() (width, height int, err error) {
	size, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ)
	return int(size.Col), int(size.Row), nil
}