Files
C/011LineNumbers/window.c
T
2026-05-15 13:26:54 -04:00

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;
}