瀏覽代碼

Don't print child output while scrolling

Jochen Sprickerhof 5 年之前
父節點
當前提交
4aa27c1b14
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      scroll.c

+ 4 - 2
scroll.c

@@ -520,8 +520,10 @@ main(int argc, char *argv[])
 
 			input[n] = '\0';
 
-			if (write(STDOUT_FILENO, input, n) == -1)
-				die("write:");
+			/* don't print child output while scrolling */
+			if (bottom == TAILQ_FIRST(&head))
+				if (write(STDOUT_FILENO, input, n) == -1)
+					die("write:");
 
 			/* iterate over the input buffer */
 			for (char *c = input; n-- > 0; c++) {