Autodetect the size of the terminal.