Use ioctl to get the terminal size.