execute

abstract suspend fun execute(context: Context, command: String, timeout: Duration? = null): Result<ExecutionResult>

Executes a shell command in the calling session's workspace.

A non-zero exit or a timeout is reported in the ExecutionResult; failing to launch the command is a Result.failure.

Return

The execution result, or an EnvironmentException failure if the command could not be launched.

Parameters

context

The caller's context, identifying the calling session.

command

The shell command string to execute.

timeout

Maximum execution time; null means no limit.