Skip to content

Commit

Permalink
Don't attempt line break at last line
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
jvalkeal committed Apr 17, 2024
1 parent 9c53282 commit 44fa13e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions terminal/src/main/java/org/jline/utils/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,10 @@ public void update(List<AttributedString> 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;
Expand Down

0 comments on commit 44fa13e

Please # to comment.