ProcessShellBackend class

A ShellBackend that runs commands and interactive shells as OS processes.

  • exec runs the request through a shell (<shell> -c "<command>") so a full command line works, unless explicit ShellRequest.args are provided, in which case the program is executed directly.
  • shell launches an interactive login shell.

The default shell is resolved from $SHELL (POSIX) or cmd.exe (Windows), overridable via defaultShell. An optional allowCommand predicate can veto commands for least-privilege deployments.

Implemented types

Constructors

ProcessShellBackend({String? defaultShell, String? workingDirectory, Map<String, String> baseEnvironment = const {}, bool allowCommand(ShellRequest request)?})
Creates a process shell backend.

Properties

allowCommand → bool Function(ShellRequest request)?
Optional guard; when provided and it returns false, the session is refused (the runtime reports node.session.rejected).
final
baseEnvironment → Map<String, String>
Extra environment overlaid on the inherited environment for every session.
final
defaultShell → String
The shell used for exec mode and as the default interactive shell.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
workingDirectory → String?
Optional working directory applied when a request does not specify one.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start(ShellRequest request) → Future<ShellSession>
Starts a session for request, returning a live ShellSession.
override
toString() → String
A string representation of this object.
inherited

Operators

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