---
title: "Pty"
hideTitleOnPage: true
---


## PtyConnectOptions

Options for connecting to a PTY session

**Properties**:

- `onData()` _\(data: Uint8Array\) =\> void \| Promise\<void\>_ - Callback to handle PTY output data
    
    **Parameters**:
    
    - `data` _Uint8Array_
    
    
    ##### Returns
    
    `void` \| `Promise<void>`
## PtyCreateOptions

Options for creating a PTY session

**Properties**:

- `cols?` _number_ - Number of terminal columns
- `cwd?` _string_ - Starting directory for the PTY session, defaults to the sandbox's working directory
- `envs?` _Record\<string, string\>_ - Environment variables for the PTY session
- `id` _string_ - The unique identifier for the PTY session
- `rows?` _number_ - Number of terminal rows
## PtyResult

PTY session result on exit

**Properties**:

- `error?` _string_ - Error message if the PTY failed
- `exitCode?` _number_ - Exit code when the PTY process ends