Skip to content

Commit 38a24fa

Browse files
committed
Avoid processCursorDown overflow on Y axis
This fix issue gradle/gradle#882.
1 parent eeda18c commit 38a24fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jansi/src/main/java/org/fusesource/jansi/WindowsAnsiOutputStream.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ protected void processCursorRight(int count) throws IOException {
213213
@Override
214214
protected void processCursorDown(int count) throws IOException {
215215
getConsoleInfo();
216-
info.cursorPosition.y = (short) Math.min(info.size.y, info.cursorPosition.y + count);
216+
info.cursorPosition.y = (short) Math.min(Math.max(0, info.size.y - 1), info.cursorPosition.y + count);
217217
applyCursorPosition();
218218
}
219219

0 commit comments

Comments
 (0)