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:
agnostic-apollo
2022-06-18 06:58:44 +05:00
parent a2df7d791a
commit 5fc2b4cd4a
4 changed files with 30 additions and 3 deletions

View File

@@ -252,6 +252,9 @@ public final class TerminalEmulator {
*/
private int mScrollCounter = 0;
/** If automatic scrolling of terminal is disabled */
private boolean mAutoScrollDisabled;
private byte mUtf8ToFollow, mUtf8Index;
private final byte[] mUtf8InputBuffer = new byte[4];
private int mLastEmittedCodePoint = -1;
@@ -2412,6 +2415,15 @@ public final class TerminalEmulator {
mScrollCounter = 0;
}
public boolean isAutoScrollDisabled() {
return mAutoScrollDisabled;
}
public void toggleAutoScrollDisabled() {
mAutoScrollDisabled = !mAutoScrollDisabled;
}
/** Reset terminal state so user can interact with it regardless of present state. */
public void reset() {
setCursorStyle();