vty/cbits/gwinsz.c
2012-04-22 15:49:25 +02:00

10 lines
189 B
C

#include <sys/ioctl.h>
unsigned long vty_c_get_window_size(void) {
struct winsize w;
if (ioctl (0, TIOCGWINSZ, &w) >= 0)
return (w.ws_row << 16) + w.ws_col;
else
return 0x190050;
}