all repos — mx @ 4ae2f6e2c20f22ebb6b3d478313dce9a89c870e6

work in progress MUA

term/utils.go (view raw)

 1package term
 2
 3import (
 4	"golang.org/x/sys/unix"
 5)
 6
 7func GetSize() (width, height int, err error) {
 8	size, err := unix.IoctlGetWinsize(0, unix.TIOCGWINSZ)
 9	return int(size.Col), int(size.Row), err
10}