[PATCH 22/25] edit: send escape sequence only for smartscroll

Sascha Hauer s.hauer at pengutronix.de
Mon Dec 13 13:09:02 PST 2021


"\e[2;<x>r" is needed to prevent the status line from scrolling out of
the window when smartscrolling is used. Only send it when smartscrolling
is actually active.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 commands/edit.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/commands/edit.c b/commands/edit.c
index 592cf4aa3d..12695d39e4 100644
--- a/commands/edit.c
+++ b/commands/edit.c
@@ -610,7 +610,9 @@ static int do_edit(int argc, char *argv[])
 				argv[1]);
 	}
 
-	printf("\x1b[2;%dr", screenheight);
+	if (smartscroll)
+		printf("\x1b[2;%dr", screenheight);
+
 	pos(0, 0);
 
 	screenheight--; /* status line */
-- 
2.30.2




More information about the barebox mailing list