mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 02:35:19 +08:00
Added: Add SCROLL
extra key to toggle auto scrolling of terminal to bottom on terminal text updates and termux activity return
The toggle will apply to each terminal session separately. Closes #2535
This commit is contained in:
@@ -409,19 +409,29 @@ public final class TerminalView extends View {
|
||||
}
|
||||
|
||||
public void onScreenUpdated() {
|
||||
onScreenUpdated(false);
|
||||
}
|
||||
|
||||
public void onScreenUpdated(boolean skipScrolling) {
|
||||
if (mEmulator == null) return;
|
||||
|
||||
int rowsInHistory = mEmulator.getScreen().getActiveTranscriptRows();
|
||||
if (mTopRow < -rowsInHistory) mTopRow = -rowsInHistory;
|
||||
|
||||
boolean skipScrolling = false;
|
||||
if (isSelectingText()) {
|
||||
if (isSelectingText() || mEmulator.isAutoScrollDisabled()) {
|
||||
|
||||
// Do not scroll when selecting text.
|
||||
int rowShift = mEmulator.getScrollCounter();
|
||||
if (-mTopRow + rowShift > rowsInHistory) {
|
||||
// .. unless we're hitting the end of history transcript, in which
|
||||
// case we abort text selection and scroll to end.
|
||||
stopTextSelectionMode();
|
||||
if (isSelectingText())
|
||||
stopTextSelectionMode();
|
||||
|
||||
if (mEmulator.isAutoScrollDisabled()) {
|
||||
mTopRow = -rowsInHistory;
|
||||
skipScrolling = true;
|
||||
}
|
||||
} else {
|
||||
skipScrolling = true;
|
||||
mTopRow -= rowShift;
|
||||
|
Reference in New Issue
Block a user