From: James Gray Date: 2008-09-26T09:27:52+09:00 Subject: Re: How to get terminal dimensions without using curses or ncurses? On Sep 25, 2008, at 5:33 PM, Kenneth McDonald wrote: > I'd like to be able to print to terminal and do some reasonable > formatting, without going to the trouble of learning curses. I > simply need to know the dimensions of the terminal, but that info > doesn't appear to be available in the ENV variables (which is what > I'd expected.) Is there a way to get this info? Sure: $ cat term_size.rb #!/usr/bin/env ruby -wKU require "rubygems" require "highline/system_extensions" p HighLine::SystemExtensions.terminal_size $ ruby term_size.rb [80, 24] You can look in that file of the source if you just want to see how HighLine is doing that on various platforms. James Edward Gray II