feat(spawn): support inherited stdio

This commit is contained in:
2026-05-10 14:32:07 +00:00
parent a0010e7f0f
commit 0ff3596bd8
4 changed files with 50 additions and 8 deletions
+10
View File
@@ -197,6 +197,16 @@ const result = await shell.execSpawn('git', ['status', '--short'], {
});
```
For trusted interactive CLIs that need the real terminal while still avoiding shell parsing, pass `stdio: 'inherit'`:
```typescript
await shell.execSpawn('opencode', ['run', '--dir', process.cwd(), prompt], {
stdio: 'inherit',
});
```
Inherited stdio returns an `IExecResult` with the exit code, but stdout and stderr are not captured because the child process writes directly to the terminal.
### Why Spawn Matters
```typescript