pty_spawn
Spawn persistent pseudo-terminal sessions to run long-running processes, send interactive commands, and manage multiple concurrent terminal sessions in real-time.
Instructions
Spawns a new PTY (pseudo-terminal) session that runs in the background.
Unlike synchronous bash commands, PTY sessions persist and allow you to:
Run long-running processes (dev servers, watch modes, etc.)
Send interactive input (including Ctrl+C, arrow keys, etc.)
Read output at any time
Manage multiple concurrent terminal sessions
Returns the session ID, which you can use with other pty_* tools.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The command to execute (e.g., 'npm', 'python', 'bash') | |
| args | No | Arguments to pass to the command | |
| workdir | No | Working directory (defaults to project root) | |
| env | No | Additional environment variables | |
| title | No | Human-readable name for the session | |
| description | Yes | Clear, concise 5-10 word description of what this command does | |
| notifyOnExit | No | Receive notification when process exits (default: false) |