Skip to content

Commit

Permalink
Don't attempt line break at last line (fixes #963) (#966)
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 4545ba7
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 4545ba7

Please sign in to comment.