In Expect 5.45.4, the stty command returns 0 rows and columns when run on MacOS on arm64 (M1):
Below I show that the shell stty command, and a simple C program, both report the correct size, but expect does not.
$ uname -a
Darwin dromedary.local 20.4.0 Darwin Kernel Version 20.4.0: Thu Apr 22 21:46:41 PDT 2021; root:xnu-7195.101.2~1/RELEASE_ARM64_T8101 arm64
$ stty -a | grep rows
speed 38400 baud; 66 rows; 138 columns;
$ echo $ROWS $COLUMNS
138
$ cat foo.c; gcc -o foo foo.c ; ./foo
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>
int main (int argc, char **argv) {
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
printf ("lines %d columns %d\n", w.ws_row, w.ws_col);
return 0;
}
lines 66 columns 138
$
$ expect -v
expect version 5.45.4
$ expect
expect1.1> stty rows
0
expect1.2> stty columns
0
This works in 5.45, fails in 5.45.4.