execute

Runs a command after asking the user for permission.

First asks the confirmation handler whether to allow the command. If approved, executes it with the specified timeout. If denied, timed out, or crashes, returns a result explaining what happened.

Return

Result containing the command output and exit code, or an error message explaining why it didn't run

Parameters

args

The command string, timeout duration, optional working directory

Throws

if canceled while the command is executing