22 lines
459 B
C
22 lines
459 B
C
#include <stdio.h>
|
|
#include <sys/ioctl.h>
|
|
#include <unistd.h>
|
|
|
|
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;
|
|
}
|