Terminal control/Dimensions: Difference between revisions
Content added Content deleted
Line 605: | Line 605: | ||
<lang tcl>set width [exec tput cols] |
<lang tcl>set width [exec tput cols] |
||
set height [exec tput lines] |
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> |
puts "The terminal is $width characters wide and has $height lines"</lang> |
||