A better function for getting terminal size