Commit 245826ab authored by Roumen Petrov's avatar Roumen Petrov

do not restrict cursor movements(up/down) to scroll region if set

parent fb8b3940
......@@ -1134,11 +1134,11 @@ private void doEscLeftSquareBracket(byte b) {
break;
case 'A': // ESC [ Pn A - Cursor Up
setCursorRow(Math.max(mTopMargin, mCursorRow - getArg0(1)));
setCursorRow(Math.max(0, mCursorRow - getArg0(1)));
break;
case 'B': // ESC [ Pn B - Cursor Down
setCursorRow(Math.min(mBottomMargin - 1, mCursorRow + getArg0(1)));
setCursorRow(Math.min(mRows - 1, mCursorRow + getArg0(1)));
break;
case 'C': // ESC [ Pn C - Cursor Right
......@@ -1337,7 +1337,8 @@ private void doEscLeftSquareBracket(byte b) {
mBottomMargin = bottom;
// The cursor is placed in the home position
setCursorRowCol(mTopMargin, 0);
// column 1, line 1 of the page(numbering from 1).
setCursorRowCol(0, 0);
}
break;
......
ESC=$'\033'
CSI="${ESC}["
# // ESC [ Pn J - ED - Erase in Display
echo -n "${CSI}2J" # // Clear all
# // Esc [ Pn ; Pn r - set top and bottom margins
echo -n "${CSI}4;7r"
# // ESC [ Pn ; H - Cursor Position
echo -n "${CSI}6;1H"
# // ESC [ Pn B - Cursor Down
echo -n "L1${CSI}BL2"
echo text1
echo text2
echo text3
#expected screen:
#<empty line>
#<empty line>
#<empty line>
# L2text1
#text2
#text3
#<PS1 prompt>
#<... empty lines ...>
ESC=$'\033'
CSI="${ESC}["
# // ESC [ Pn J - ED - Erase in Display
echo -n "${CSI}2J" # // Clear all
# // Esc [ Pn ; Pn r - set top and bottom margins
echo -n "${CSI}4;7r"
# // ESC [ Pn ; H - Cursor Position
echo -n "${CSI}7;1H"
# // ESC [ Pn B - Cursor Down
echo -n "L1${CSI}BL2"
echo text1
echo text2
echo text3
#expected screen:
#<empty line>
#<empty line>
#<empty line>
#L1
#text2
#text3
#<PS1 prompt>
# L2text1
#<... empty lines ...>
ESC=$'\033'
CSI="${ESC}["
# // ESC [ Pn J - ED - Erase in Display
echo -n "${CSI}2J" # // Clear all
# // Esc [ Pn ; Pn r - set top and bottom margins
echo -n "${CSI}4;7r"
# // ESC [ Pn ; H - Cursor Position
echo -n "${CSI}3;1H"
# // ESC [ Pn A - Cursor Up
echo -n "L1${CSI}AL2"
cat <<EOF
text1
text2
text3
text4
text5
text6
text7
EOF
#expected screen:
#<empty line>
# L2
#text2
#text5
#text6
#text7
#<PS1 prompt>
#<... empty lines ...>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment