PasswordPromptDetector class final

Watches a command's output stream for password asks and resolves them through onPrompt. One answer at a time: while an answer is pending the detector stays muted; after it resolves the next detected ask re-arms (a wrong-password retry opens the sheet again — GOAL #367 E1).

Constructors

PasswordPromptDetector({required FutureOr<void> onPrompt(String promptLine), Duration quiet = const Duration(milliseconds: 250), int windowSize = 200})
Creates a detector. quiet is the silence window the prompt must hold before the sheet fires (chunked streams routinely end a chunk at a colon; only a QUIET colon is a waiting prompt). windowSize caps the rolling tail the patterns match against.

Properties

hashCode int
The hash code for this object.
no setterinherited
onPrompt FutureOr<void> Function(String promptLine)
final
quiet Duration
How long the matched prompt must stay the last output before the host is asked.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Stops watching; cancels any pending fire. An answer already in flight is left to its owner.
feed(String chunk) → void
Feeds one output chunk (stdout and stderr alike — sudo prompts on stderr). Any output resets the quiet window: a pending fire is re-evaluated against the new tail.
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