// 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, err := unix.IoctlGetWinsize(int(out.Fd()), unix.TIOCGWINSZ)
	if err != nil {
		return 0, 0, err
	}
	return int(ws.Col), int(ws.Row), nil
}
func TerminalSize ( out * os . File ) ( int , int , error ) { ws , err := unix . IoctlGetWinsize ( int ( out . Fd ( ) ) , unix . TIOCGWINSZ ) if err != nil { return 0 , 0 , err } return int ( ws . Col ) , int ( ws . Row ) , nil }
TerminalSize retrieves the cols/rows for the terminal connected to out.
TerminalSize retrieves the cols / rows for the terminal connected to out .