// TerminalSize retrieves the cols/rows for the terminal connected to out.

TerminalSize retrieves the cols/rows for the terminal connected to out.
// TerminalSize retrieves the cols / rows for the terminal connected to out .
func TerminalSize(out *os.File) (int, int, error) {
	ws := new(winsize)
	_, _, err := syscall.Syscall(syscall.SYS_IOCTL, out.Fd(),
		uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws)))
	if err != 0 {
		return 0, 0, err
	}
	return int(ws.cols), int(ws.rows), nil
}
func TerminalSize ( out * os . File ) ( int , int , error ) { ws := new ( winsize ) _ , _ , err := syscall . Syscall ( syscall . SYS_IOCTL , out . Fd ( ) , uintptr ( syscall . TIOCGWINSZ ) , uintptr ( unsafe . Pointer ( ws ) ) ) if err != 0 { return 0 , 0 , err } return int ( ws . cols ) , int ( ws . rows ) , nil }
TerminalSize retrieves the cols/rows for the terminal connected to out.
TerminalSize retrieves the cols / rows for the terminal connected to out .