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), err }