exec() and run() do not return stdout or stderr. Use the onStdio hook to capture output.
Basic capture
Default hook
Set a runtime-level hook that applies to all executions:StdioHook type
Patterns
Collect to array:Why no buffering?
Buffering console output by default would let untrusted code grow host memory without bound by logging at high volume. The explicitonStdio hook puts you in control of how output is stored and when to stop collecting.