D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Terminal size?

 

On Wed, 29 Apr 2009, Tom Potts wrote:

> On Wednesday 29 April 2009 16:39, Grant Sewell wrote:
>> Hi all,
>>
>> Is there a way to find out the size (WxH) of the current
>> terminal/console session from within BASH?  I am trying to write a menu
>> system using dialog for the "interface", and I would like to set the
>> position and sizes of the various dialogues nicely.
>>
>> Cheers.
>> Grant. :)
> $LINES $COLUMNS

Not present in all shells, but as you are using bash, it mostly works..

> I think you can set it using stty but catching problems is a problem.
> try ncurses - I really should write a WYSIWIG form editor for ncurses in
> ncurses.. !

You can also get it with stty:

   stty size

   gordon @ unicorn: stty size
   76 100

Gordon


-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html