ScreenModeDetector class
Detects when the remote terminal switches into or out of the alternate screen buffer, by watching the output byte stream for the DEC private-mode sequences full-screen programs emit:
- enter:
ESC [ ? 1049 h(also the olderESC [ ? 1047 h) - leave:
ESC [ ? 1049 l(also the olderESC [ ? 1047 l)
nano, vim, less, top and htop all toggle the alternate screen this
way. The connect client uses the transition to switch its LineEditor
between local line editing and raw passthrough: while a full-screen app owns
the screen, keystrokes must reach the app unmodified rather than being parsed
as a local command line.
The detector is a passive observer — it never alters the bytes (they are still forwarded to the local terminal so it mirrors the alternate-screen switch). Sequences split across feed chunks are handled by carrying over a short suffix between calls.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inAltScreen ↔ bool
-
Whether the remote terminal is currently in the alternate screen buffer.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
feed(
List< int> chunk) → bool -
Feeds a chunk of remote output. Returns
truewhen inAltScreen changed as a result. Never modifies or consumes the forwarded bytes. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Clears carried state and resets to the non-alternate screen.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited