anthropics / anthropics/sandbox-runtime

Feature Request: TTY passthrough for interactive terminal applications

Open
#76 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
5.2k
Forks
439
Avg merge
2d 9m
Merged PRs (30d)
13

Description

## Summary

Add TTY passthrough support to enable running interactive terminal applications (like Claude Code) inside the sandbox.

## Problem

When running Claude Code inside srt, the sandbox blocks TTY operations causing this error:

```
Error: setRawMode EPERM
at ReadStream.setRawMode (node:tty:81:24)
```

Claude Code requires `setRawMode` for its interactive TUI (terminal user interface). The macOS `sandbox-exec` blocks these ioctl operations.

## Current Behavior

- Simple commands work: `srt echo "hello"` ✓
- Interactive TUI apps fail: `srt claude` ✗

## Requested Behavior

Add an option to allow TTY passthrough, e.g.:

```bash
srt --tty claude
```

Or via config:

```json
{
"process": {
"allowTTY": true
}
}
```

## Use Case

Running Claude Code in a sandboxed environment where:
- Filesystem writes are restricted to the current project directory
- Network access is allowed
- But full interactive terminal UI is needed

## Environment

- macOS (sandbox-exec)
- srt version: 0.0.23
- Claude Code version: 2.0.59

## Workaround

Currently using `--print` mode for non-interactive use, but this loses the full TUI experience.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.