[hackers] [scroll][PATCH] Don't retain any clear screen sequence variants.

From: Ian Remmler <ian_AT_remmler.org>
Date: Sat, 25 Apr 2020 16:08:54 -0500

Elide all clear screen escape sequences from the scrollback buffer,
partial or complete. zshell, for example, emits ^[[J on startup, which
causes the scrolled down portion of the screen to be cleared when
scrolling to the beginning of the buffer and less than the entire screen
is scrolled.
---
 scroll.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scroll.c b/scroll.c
index 722ea01..f0e5ba5 100644
--- a/scroll.c
+++ b/scroll.c
_AT_@ -208,7 +208,11 @@ skipesc(char c)
 
 			/* don't save cursor move or clear screen */
 			/* esc sequences to log */
-			if (c == 'H' || strcmp(buf, "2J") == 0)
+			if (c == 'H' || strcmp(buf, "J") == 0 ||
+				strcmp(buf, "0J") == 0 ||
+				strcmp(buf, "1J") == 0 ||
+				strcmp(buf, "2J") == 0 ||
+				strcmp(buf, "3J") == 0)
 				return true;
 		}
 		break;
-- 
2.26.2
Received on Sat Apr 25 2020 - 23:08:54 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 25 2020 - 23:48:40 CEST