Commits

Evan Gates  committed 255e465

don't clear screen or print terminal size on sigwinch, just reprint file

  • Participants
  • Parent commits 2792a82

Comments (0)

Files changed (1)

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