Improved help. Moving to 0.2.
#include <sys/ioctl.h>
#include <termios.h>
#include <sys/types.h>
#include <stdio.h>
#include "main.h"
static char xterm_resize_string[100];
char * get_xterm_resize_string()
{
struct winsize win;
int rows, cols;
/* Get rows and cols from our connection to the terminal: fd 1 */
ioctl(1, TIOCGWINSZ, (char *)&win);
rows = win.ws_row;
cols = win.ws_col;
/* Prepare the xterm resize string */
snprintf(xterm_resize_string, sizeof xterm_resize_string,
"\033[8;%i;%it", rows, cols);
return xterm_resize_string;
}