Explorar o código

don't save clear screen esc sequences in backlogbuffer

Jan Klemkow %!s(int64=5) %!d(string=hai) anos
pai
achega
ab4da6cf31
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      scroll.c

+ 7 - 0
scroll.c

@@ -410,6 +410,13 @@ main(int argc, char *argv[])
 			if (n == -1 && errno != EINTR)
 				die("read:");
 
+			/* don't save clear screen esc sequences in log */
+			if (strncmp("\033[H\033[2J", input, n) == 0) {
+				if (write(STDOUT_FILENO, input, n) == -1)
+					die("write:");
+				continue;
+			}
+
 			/* iterate over the input buffer */
 			for (char *c = input; n-- > 0; c++) {
 				/* don't save lines from alternative screen */