RemoteSession class

A client-side handle to one open session on a node.

Wraps the session's Channel: writes go to the remote stdin, stdout and stderr stream the remote output in real time, and exitCode completes when the remote process exits. Control helpers (resize, interrupt, sendSignal, sendEof) issue the matching protocol messages.

Constructors

RemoteSession(Channel _channel, SessionMode mode)
Creates a remote-session handle over the given channel.

Properties

detachOutcome DetachOutcome?
The detach result if the session was detached, else null. Carries the short id to resume with — useful when the detach was triggered externally.
no setter
exitCode Future<int>
Completes with the remote process exit code (or -1 if the session closed without a clean exit).
no setter
hashCode int
The hash code for this object.
no setterinherited
id SessionId?
The session id (available once opened completes).
no setter
mode SessionMode
Exec or interactive shell.
final
opened Future<void>
Completes once the node confirms the session is open, or completes with a SessionRejectedException if it was refused.
no setter
queuedBytes int
Bytes queued locally awaiting send credit (for transfer backpressure).
no setter
resumedInAltScreen bool
Whether this (resumed) session opened inside a full-screen program's alternate screen. When true, the host should attach in passthrough and not prime a prompt (the replayed output repaints the program; its already- queued completion marker restores the prompt when it exits).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shellFamily ShellFamily
The command-language family of the remote shell (available once opened completes; posix until then and for older nodes). The interactive host uses it to pick the matching ShellDialect.
no setter
stderr Stream<Uint8List>
Remote standard error bytes, streamed live.
no setter
stdout Stream<Uint8List>
Remote standard output bytes, streamed live.
no setter
wasDetached bool
Whether this session was detached (by this client's detach, or from another connection) rather than closed/exited.
no setter

Methods

close() Future<void>
Closes the session, asking the node to terminate the process.
detach({Duration? timeout}) Future<DetachOutcome>
Detaches this session: asks the node to keep the PTY, shell and child processes running while the client disconnects. Completes with the detached session's id and short handle once the node confirms.
grantWindow(int credit) → void
Grants the peer credit more bytes of send window (transfer flow control).
interrupt() → void
Sends SIGINT to the remote process (Ctrl+C).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize({required int cols, required int rows}) → void
Resizes the remote terminal.
sendEof() → void
Signals end-of-input on the remote standard input.
sendSignal(String signal) → void
Sends the named POSIX signal to the remote process.
toString() String
A string representation of this object.
inherited
writeStdin(List<int> data) → void
Writes data to the remote standard input.

Operators

operator ==(Object other) bool
The equality operator.
inherited