[db] use tput to determine the terminal size if appropriate