vlcek@mit-caf.MIT.EDU (Jim Vlcek) (09/20/90)
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)