ShellDialect class abstract
Generates the shell-specific text the interactive connect/resume loop
sends to a remote shell: a one-time init line, the per-command wrapper, and
the prompt-completion markers.
The parsing of marker output is shell-agnostic and stays in CwdMarker;
only the emitted command syntax differs per ShellFamily. Each marker emits
the same line format the parser expects — the token immediately followed by
cwd, then tab-separated branch, status and priv fields:
<token><cwd>\t<branch>\t<status>\t<priv>\n
A ping marker emits just <token>\n (no fields) to signal completion
without re-querying git state.
- Implementers
Constructors
- ShellDialect()
-
const
Properties
- echoesInput → bool
-
Whether the shell writes a prompt and each command line it reads back to
stdout (see
EchoFilter), so the client must drop them.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- initLine → String?
-
A single command sent once when the session opens (e.g. installing a
Ctrl-C trap or suppressing the shell's prompt), or
nullif none.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
agentLine(
String line) → String -
The AI agent's
lineprepared to run before an agentMarker (state the marker needs to tell the line's exit code). Unchanged by default. -
agentMarker(
CwdMarker marker) → String -
A marker that also reports the preceding command's exit code (used when the
AI agent runs a command in the interactive session). POSIX and PowerShell
carry the exit code;
cmdfalls back to fullMarker, so its exit code is unknown. -
completionCommand(
String word, {required bool isCommand}) → String -
A command, in this dialect, that prints TAB-completion candidates for
word— one per line, each a full replacement for the typed word (so it includes whatever was typed), with directories suffixed/so the editor can avoid appending a trailing space. -
expandShortcut(
String line) → String -
Expands the client-side
lshortcut: a line whose first word islbecomes listCommand with the rest of the line as its arguments. Any other line is returned unchanged. -
fullMarker(
CwdMarker marker) → String - The full marker command: reports cwd plus git branch/status and privilege.
-
listCommand(
String args) → String -
A command, in this dialect, that lists a directory including hidden
entries and with human-readable sizes (the
ls -alhequivalent).argsis the raw text typed after the shortcut (paths, extra flags), appended verbatim; empty lists the current directory. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pingMarker(
CwdMarker marker) → String - The lightweight ping marker: signals completion only (no git queries).
-
sessionInitLine(
CwdMarker marker) → String? -
The initLine for the session
markerbelongs to — the line the client actually sends. The same as initLine unless the dialect ties it to the session (PowerShell's prompt sentinel). -
toString(
) → String -
A string representation of this object.
inherited
-
wrapCommand(
String line, {required bool interactive, required String tail}) → String -
Wraps a user-typed
lineso it runs and is followed bytail(a marker) as one logical unit.interactiveenables terminal-echo handling where the dialect needs it (POSIX only: no tty echo to toggle over a pipe; PowerShell's own prompt and echo of the line are filtered instead, see echoesInput).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
forFamily(
ShellFamily family) → ShellDialect -
Returns the dialect for
family.