From 44fa13e4d7ef8f806936b3b576bfcc9a049ae0ad Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Wed, 17 Apr 2024 11:31:58 +0100 Subject: [PATCH] Don't attempt line break at last line - This fixes issue in Display which should not do a line break on fullscreen mode for a last line causing scrolling and making screen of by one line. - Fixes #963 --- terminal/src/main/java/org/jline/utils/Display.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/terminal/src/main/java/org/jline/utils/Display.java b/terminal/src/main/java/org/jline/utils/Display.java index b8fb88342..1874fb59b 100644 --- a/terminal/src/main/java/org/jline/utils/Display.java +++ b/terminal/src/main/java/org/jline/utils/Display.java @@ -308,8 +308,10 @@ public void update(List newLines, int targetCursorPos, boolean } } else if (atRight) { if (this.wrapAtEol) { - terminal.writer().write(" \b"); - cursorPos++; + if (!fullScreen || (fullScreen && lineIndex < numLines)) { + terminal.writer().write(" \b"); + cursorPos++; + } } else { terminal.puts(Capability.carriage_return); // CR / not newline. cursorPos = curCol;