set width [exec tput cols] set height [exec tput lines] puts "The terminal is $width characters wide and has $height lines"