CwdMarker class
Client-side shell integration that learns the remote working directory.
The interactive connect loop has no PTY, so the remote shell prints no
prompt and there is no command-completion signal. After each forwarded
command this marker's command is enqueued on the remote stdin; the shell
runs it once the command finishes and emits a single line carrying $PWD.
feed scans the live stdout stream for that line, strips it from the output,
and surfaces the parsed directory — which also tells the caller when to
redraw the prompt.
The detection token is a random nonce, but command splits it across two
printf arguments so the literal command text we send never contains the
full token. This avoids false matches when an interactive program (e.g.
cat) echoes the marker line back verbatim.
Properties
- command → String
-
The shell command (without trailing newline) to enqueue after a command.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- pingCommand → String
-
A lightweight completion marker (without trailing fields) to enqueue after
commands that cannot change the prompt's cwd/git state.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token → String
-
The full token emitted by the marker line and searched for in output.
final
- tokenHalves → (String, String)
-
The token split into two halves, for emitting it across two literal
arguments so the full token never appears verbatim in the command text we
send (which would false-match if an interactive program echoed it back).
Shared by every ShellDialect that builds its own marker command.
no setter
Methods
-
feed(
Uint8List chunk) → CwdScan - Feeds a chunk of remote stdout, returning clean output and any cwd found.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited