Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!media-lab!mit-caf!vlcek From: vlcek@mit-caf.MIT.EDU (Jim Vlcek) Newsgroups: comp.unix.aix Subject: Window size in AIX PS/2 V1.1 Message-ID: <5129@mit-caf.MIT.EDU> Date: 20 Sep 90 03:53:14 GMT Reply-To: vlcek@mit-caf.UUCP (Jim Vlcek) Distribution: na Organization: Microsystems Technology Laboratories, MIT Lines: 23 Anyone know a robust way to determine the current window size in AIX PS/2 V1.1? This is to get the current dimensions of a resizable xterm window. I tried the following snippet: if (ioctl(fileno(stdout), TIOCGWINSZ, &win) < 0) perror("ioctl"); else printf("ioctl: lines=%d, cols=%d\n", win.ws_row, win.ws_col); with the following results: ioctl: Invalid argument Using the termcap routines (tgetent, tgetnum) in -lcurses (yes, AIX puts them there) gives an answer, but it's the static values in the terminfo data base, and hence doesn't account for window resizing. /bin/csh on AIX PS/2 also doesn't appear to intercept SIGWINCH; resizing the window has no effect on the output of "stty everything". "stty everything" also yields no information on the number of columns, although stty accepts a "cols" argument. Jim Vlcek (vlcek@caf.mit.edu vlcek@athena.mit.edu)