| From | Sent On | Attachments |
|---|---|---|
| Craig P McDaniel | May 2, 2000 4:44 pm | |
| Doug Stanfield | May 3, 2000 1:41 am | |
| Donn Cave | May 3, 2000 9:46 am | |
| Martin P Holland | May 3, 2000 12:04 pm | |
| Doug Stanfield | May 3, 2000 12:06 pm | |
| Samuel A. Falvo II | May 3, 2000 1:00 pm | |
| Justin Sheehy | May 3, 2000 2:37 pm | |
| Doug Stanfield | May 3, 2000 3:07 pm | |
| Justin Sheehy | May 3, 2000 4:47 pm | |
| Donn Cave | May 3, 2000 5:32 pm | |
| Juergen A. Erhard | May 3, 2000 7:51 pm | |
| Quinn Dunkan | May 3, 2000 10:02 pm | |
| Donn Cave | May 4, 2000 9:28 am | |
| Greg Ewing | May 4, 2000 7:20 pm | |
| Jeff Bauer | May 4, 2000 7:40 pm | |
| Paul Jackson | May 4, 2000 7:57 pm | |
| Mark Jackson | May 4, 2000 8:00 pm | |
| David Arnold | May 4, 2000 8:09 pm | |
| Bjorn Pettersen | May 4, 2000 8:42 pm | |
| Donn Cave | May 5, 2000 9:44 am | |
| Bjorn Pettersen | May 5, 2000 11:22 am | |
| Radovan Garabik | May 5, 2000 1:46 pm | |
| Donn Cave | May 5, 2000 2:50 pm | |
| Paul Jackson | May 5, 2000 3:17 pm |
| Subject: | How to get terminal width? | |
|---|---|---|
| From: | Donn Cave (do...@u.washington.edu) | |
| Date: | May 5, 2000 9:44:43 am | |
| List: | org.python.python-list | |
Quoth Bjorn Pettersen <bjorn at roguewave.com>: | Paul Jackson wrote: | > | > "stty size" isn't defined on my Irix box, but: | > | > tput cols | > | > works on each of my Irix, SuSE and TurboLinux boxes, | > issuing simply the number of columns. | | Well, we're getting closer :-) | | The above doesn't work on: | | SunOS 4.1.4 (not present) | SunOS 5.4 (wrong result) | | But does work on: | | RedHat 6.0 | Solaris 2.6, 2.7 (7), 8 | HPUX 10.20, 11 | AIX 4.2, 4.3 | IRIX64 6.2, 6.5 | Dec 3.2
And it works on FreeBSD 4.0, and BeOS 4.5 and 5.0
However - "tput" is really mainly about terminal-specific information retrieved from termcap/terminfo, and that shows in a couple of ways. On BeOS, and I bet a few other platforms, I get "80" regardless of my actual window size. It can get the information from the terminal description, and that's probably legitimate if not ideal. Tput also fails when the terminal type is unknown (a marginal problem, but could be worse than you might think, if the platform suffers from the all too common terminfo vs. termcap split.) All this goes back to the dark ages when we had real terminals, with more or less fixed screen sizes.
Donn Cave, University Computing Services, University of Washington donn at u.washington.edu





