2012-09-06 09:47:52 +04:00
|
|
|
#include <stdio.h>
|
2013-03-26 09:24:26 +04:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <termios.h>
|
2012-09-06 09:47:52 +04:00
|
|
|
|
2012-09-07 01:54:05 +04:00
|
|
|
int main(int argc, char * argv[]) {
|
2013-03-26 09:24:26 +04:00
|
|
|
struct winsize w;
|
|
|
|
int width, height;
|
|
|
|
ioctl(0, TIOCGWINSZ, &w);
|
|
|
|
width = w.ws_col;
|
|
|
|
height = w.ws_row;
|
|
|
|
printf("Terminal is %dx%d\n", width, height);
|
2012-09-06 09:47:52 +04:00
|
|
|
}
|