tput, reset - initialize a terminal or query terminfo database

Terminal Size
lines and cols
inspects the environment variables LINES and
COLUMNS which may override the terminal size