Terminal control/Dimensions: Difference between revisions

Line 605:
<lang tcl>set width [exec tput cols]
set height [exec tput lines]
puts "The terminal is $width characters wide and has $height lines"</lang>
 
=== Alternative ===
'''Requires''': GNU coreutils
<lang tcl>lassign [exec stty size] width height
puts "The terminal is $width characters wide and has $height lines"</lang>
 
Anonymous user