From 4545ba7cae5f11b71f8a180e44dc4a7e86e86a6b Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Wed, 17 Apr 2024 12:00:24 +0100 Subject: [PATCH] Don't attempt line break at last line (fixes #963) (#966) - 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;