How to get terminal width?

Mark Jackson mjackson at wc.eso.mc.xerox.com
Thu May 4 23:00:49 EDT 2000


Jeff Bauer <jbauer at rubic.com> writes:
> Donn Cave wrote:
> > Quoth newsbunny at noether.freeserve.co.uk (Martin P Holland):
> > | stty size
> > |
> > | just gives the rows and columns here (linux) but may be this is
> > | not standard.
> > 
> > It looks pretty good to me!  Ultrix 4.2, Digital UNIX 4.0, AIX 4.2,
> > HP/UX 10.20, FreeBSD 4.0, 2 versions of Linux and BeOS 4.5 pass on
> > this one, and that's all I can dig up to try, so it looks to me like
> > the best bet so far.  Easiest to handle in Python, too.
> 
> Donn/Martin:
> 
> It fails on Solaris 2.6  (and probably other versions of Solaris):
> 
> $ stty size
> unknown mode: size

Depends on the path.  Fails for /usr/bin/stty (probably the most common
default); works for /usr/ucb/stty.

-- 
Mark Jackson - http://www.alumni.caltech.edu/~mjackson
	In judging others, folks will work overtime for no pay.
				- Charles Carruthers





More information about the Python-list mailing list