[Tutor] How to get terminal settings

Vincent Zee zenzee at xs4all.nl
Fri Jan 20 10:05:49 CET 2006


On Thursday, 19 January 2006 at 23:53:06 -0000, Alan Gauld wrote:
> Assuming you are on a Unix style OS/terminal you can read the 
> output of stty. Look at the rows value
> 
> Here are a couple of runs of rows at different terminal sizes:
> 
> $ stty -a | grep rows
> speed 38400 baud; rows 41; columns 80; line = 0;
> 
> $ stty -a | grep rows
> speed 38400 baud; rows 26; columns 80; line = 0;
> 
> A call to Popen should get you what you want.
> 
> An alternative technique, and the one useed by the real 
> more/less programmes is to use curses to open a display 
> window.
> 
Hi Alan,

this has helped me very much, thank you.
I'll use the popen() before venturing into curses land.

/\
Vincent


More information about the Tutor mailing list