Skip to content

Commit

Permalink
Fixed: Make ScrollDown escape respect margins
Browse files Browse the repository at this point in the history
SD sequence (`${CSI}${N}T`) was scrolling the whole width
 of the terminal instead of just between the margins.
Fixed that.

Fixes termux#2576 where in tmux scrolling one of several
 side-by-side panels down resulted in all visually scrolling.
  • Loading branch information
evg-zhabotinsky authored and KitsunedFox committed Sep 25, 2022
1 parent 39fd865 commit b5fbf68
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -1730,8 +1730,8 @@ private void doCsi(int b) {
final int linesToScrollArg = getArg0(1);
final int linesBetweenTopAndBottomMargins = mBottomMargin - mTopMargin;
final int linesToScroll = Math.min(linesBetweenTopAndBottomMargins, linesToScrollArg);
mScreen.blockCopy(0, mTopMargin, mColumns, linesBetweenTopAndBottomMargins - linesToScroll, 0, mTopMargin + linesToScroll);
blockClear(0, mTopMargin, mColumns, linesToScroll);
mScreen.blockCopy(mLeftMargin, mTopMargin, mRightMargin - mLeftMargin, linesBetweenTopAndBottomMargins - linesToScroll, mLeftMargin, mTopMargin + linesToScroll);
blockClear(mLeftMargin, mTopMargin, mRightMargin - mLeftMargin, linesToScroll);
} else {
// "${CSI}${func};${startx};${starty};${firstrow};${lastrow}T" - initiate highlight mouse tracking.
unimplementedSequence(b);
Expand Down

0 comments on commit b5fbf68

Please sign in to comment.