Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* How to get the terminal size?
@ 1997-06-19  4:00 Peter Neilley
  0 siblings, 0 replies; only message in thread
From: Peter Neilley @ 1997-06-19  4:00 UTC (permalink / raw)



<HTML>
Newbie here... I'm porting code developed on a SunOS/Solaris/IRIX/HP/Ultrix/LINUX,
etc. platforms
<BR>to a Digital Unix machine.&nbsp; I&nbsp;need to know how to get the
current terminal size (rows/columns)
<BR>without having to resort to using the curses lib.&nbsp; On the previous
systems I&nbsp;used an ioctl call (see below),
<BR>but this doesn't seem to be supported under Digital Unix.&nbsp; I'm
working very remotely from the machine
<BR>(and manuals)&nbsp;so if&nbsp; someone could help, I'd appreciate it.
<BR>----------------------
<BR>Elements of code for getting terminal size that doesn't seem to be
supported on Digital Unix:

<P>struct winsiz WINSIZ;
<BR>int TERM_FD;
<BR>.
<BR>.
<BR>if (&nbsp;TERM_FD = open("/dev/tty",O_RDWR)&nbsp;......
<BR>.
<BR>.
<BR>if (&nbsp;ioctl(TERM_FD,TIOCGWINSZ,&amp;WINSIZ)&nbsp;== 0 )
<BR>&nbsp; {
<BR>&nbsp;&nbsp; *lines = WINSIZ.ws_row;
<BR>&nbsp;&nbsp; *cols = WINSIZ.ws_col;
<BR>.
<BR>.
<BR>
<PRE>&nbsp;
--&nbsp;
Peter Neilley, NCAR/RAP
neilley@ucar.edu</PRE>
</HTML>




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-06-19  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-06-19  4:00 How to get the terminal size? Peter Neilley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox