Window size in AIX PS/2 V1.1

Jim Vlcek vlcek at mit-caf.MIT.EDU
Thu Sep 20 13:53:14 AEST 1990


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 at caf.mit.edu  vlcek at athena.mit.edu)



More information about the Comp.unix.aix mailing list