submitLine method
Submits a committed command line (the host performed the line editing).
A blank line just repaints the prompt; otherwise the command is wrapped with a marker tail and dispatched, and the terminal enters passthrough until the marker returns.
Implementation
void submitLine(String line) {
if (_ended) return;
if (line.trim().isEmpty) {
onPrompt(_promptState());
return;
}
_inFlight = true;
onPassthrough(true);
final tail = mayChangeCwdOrGit(line)
? _dialect.fullMarker(_marker)
: _dialect.pingMarker(_marker);
final command = _dialect.wrapCommand(
line,
interactive: _interactive,
tail: tail,
);
_send('$command\n');
}