Sfoglia il codice sorgente

don't save clear screen esc sequences in backlogbuffer

Jan Klemkow 5 anni fa
parent
commit
ab4da6cf31
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  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 */