#include #include #include "con.h" struct consz con_size(void) { struct winsize w; ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); return (struct consz) { w.ws_row, w.ws_col }; } unsigned con_rows(void) { return con_size().rows; } unsigned con_cols(void) { return con_size().cols; }