File tree 1 file changed +29
-3
lines changed
src/main/java/org/fusesource/jansi
1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -716,19 +716,45 @@ public Ansi scrollDown(final int rows) {
716
716
return rows > 0 ? appendEscapeSequence ('T' , rows ) : rows < 0 ? scrollUp (-rows ) : this ;
717
717
}
718
718
719
+ @ Deprecated
720
+ public Ansi restorCursorPosition () {
721
+ return restoreCursorPosition ();
722
+ }
723
+
719
724
public Ansi saveCursorPosition () {
725
+ saveCursorPositionSCO ();
726
+ return saveCursorPositionDEC ();
727
+ }
728
+
729
+ // SCO command
730
+ public Ansi saveCursorPositionSCO () {
720
731
return appendEscapeSequence ('s' );
721
732
}
722
733
723
- @ Deprecated
724
- public Ansi restorCursorPosition () {
725
- return appendEscapeSequence ('u' );
734
+ // DEC command
735
+ public Ansi saveCursorPositionDEC () {
736
+ builder .append (FIRST_ESC_CHAR );
737
+ builder .append ('7' );
738
+ return this ;
726
739
}
727
740
728
741
public Ansi restoreCursorPosition () {
742
+ restoreCursorPositionSCO ();
743
+ return restoreCursorPositionDEC ();
744
+ }
745
+
746
+ // SCO command
747
+ public Ansi restoreCursorPositionSCO () {
729
748
return appendEscapeSequence ('u' );
730
749
}
731
750
751
+ // DEC command
752
+ public Ansi restoreCursorPositionDEC () {
753
+ builder .append (FIRST_ESC_CHAR );
754
+ builder .append ('8' );
755
+ return this ;
756
+ }
757
+
732
758
public Ansi reset () {
733
759
return a (Attribute .RESET );
734
760
}
You can’t perform that action at this time.
0 commit comments