#include #include #include int main(int argc, char *argv[]) { struct winsize win; /* * unsigned short ws_row * unsinged short ws_col * unsighed short ws_xpixel * unsinged short ws_ypixel */ ioctl(STDOUT_FILENO, TIOCGWINSZ, &win); printf("Lines: %d\n", win.ws_row); printf("chars: %d\n", win.ws_col); printf("xpixel: %d\n", win.ws_xpixel); printf("ypixel: %d\n", win.ws_ypixel); return 0; }