Commits

Anonymous committed c24bf03

print out size again

  • Participants
  • Parent commits 7ab0f38

Comments (0)

Files changed (1)

 #include <string.h>
 #include <unistd.h>
 
+#include <sys/ioctl.h>
 #include <sys/select.h>
 #include <sys/inotify.h>
 
 
 static void sigwinch(int unused)
 {
+	struct winsize ws;
+
+	if (ioctl(STDERR, TIOCGWINSZ, &ws) < 0)
+		warn("failed ioctl");
+
+	printf("SIZE %d %d\n", ws.ws_row, ws.ws_col);
+	fflush(stdout);
+
 	rewind(in);
 
 	while (fgets(buf, sizeof(buf), in))