diff options
| author | Tolik Malibroda <[email protected]> | 2025-06-04 08:24:33 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-04 08:24:33 +0200 |
| commit | 4b2af10b0478fc8f92fe848019a0bc2d8943ed88 (patch) | |
| tree | 98b36ecefe645f4770dbf82f733d950b332e9466 /packages/cli/src | |
| parent | 7de790fbf236193191a33482793ee3ec5943d62d (diff) | |
fix: Fix piped input mode in sandbox (#739)
Diffstat (limited to 'packages/cli/src')
| -rw-r--r-- | packages/cli/src/utils/sandbox.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index 1f8e74c9..f33cb480 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -320,9 +320,14 @@ export async function start_sandbox(sandbox: string) { process.exit(1); } - // use interactive tty mode and auto-remove container on exit + // use interactive mode and auto-remove container on exit // run init binary inside container to forward signals & reap zombies - const args = ['run', '-it', '--rm', '--init', '--workdir', workdir]; + const args = ['run', '-i', '--rm', '--init', '--workdir', workdir]; + + // add TTY only if stdin is TTY as well, i.e. for piped input don't init TTY in container + if (process.stdin.isTTY) { + args.push('-t'); + } // mount current directory as working directory in sandbox (set via --workdir) args.push('--volume', `${process.cwd()}:${workdir}`); |
