Skip to content

Commit

Permalink
Send both SCO and DEC command for save/restore cursor position (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Sep 28, 2023
1 parent 3b15c26 commit 48ac368
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/main/java/org/fusesource/jansi/Ansi.java
Original file line number Diff line number Diff line change
Expand Up @@ -717,16 +717,26 @@ public Ansi scrollDown(final int rows) {
}

public Ansi saveCursorPosition() {
return appendEscapeSequence('s');
// SCO command
appendEscapeSequence('s');
// DEC command
builder.append(FIRST_ESC_CHAR);
builder.append('7');
return this;
}

@Deprecated
public Ansi restorCursorPosition() {
return appendEscapeSequence('u');
return restoreCursorPosition();
}

public Ansi restoreCursorPosition() {
return appendEscapeSequence('u');
// SCO command
appendEscapeSequence('u');
// DEC command
builder.append(FIRST_ESC_CHAR);
builder.append('8');
return this;
}

public Ansi reset() {
Expand Down

0 comments on commit 48ac368

Please sign in to comment.