Skip to content

Commit

Permalink
Movement with cursorUpLine/cursorDownLine don't work on windows, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 1, 2020
1 parent 2e84084 commit 090132d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/org/fusesource/jansi/WindowsAnsiProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,22 @@ protected void processCursorToColumn(int x) throws IOException {
applyCursorPosition();
}

@Override
protected void processCursorUpLine(int count) throws IOException {
getConsoleInfo();
info.cursorPosition.x = 0;
info.cursorPosition.y = (short) Math.max(info.window.top, info.cursorPosition.y - count);
applyCursorPosition();
}

@Override
protected void processCursorDownLine(int count) throws IOException {
getConsoleInfo();
info.cursorPosition.x = 0;
info.cursorPosition.y = (short) Math.max(info.window.top, info.cursorPosition.y + count);
applyCursorPosition();
}

@Override
protected void processSetForegroundColor(int color, boolean bright) throws IOException {
info.attributes = (short) ((info.attributes & ~0x0007) | ANSI_FOREGROUND_COLOR_MAP[color]);
Expand Down

0 comments on commit 090132d

Please sign in to comment.