# TtyPtyBinding

`import { TtyPtyBinding } from "destack:tty/binding";`

Pty binding family.

```ds title="TtyPtyBinding"
export interface TtyPtyBinding {
    openPty(options: &'a readonly PtyOpenOptions): Result<PtyPair, HostError>;
    readPty(pty: PtyHandle, buffer: &'a [uint8]): Result<uint64, HostError>;
    writePty(pty: PtyHandle, buffer: &'a readonly [uint8]): Result<uint64, HostError>;
    closePty(pty: PtyHandle): Result<void, HostError>;
}
```

[language/library/src/tty/binding/pty.ds:25:61](https://github.com/destack-sh/destack/blob/main/language/library/src/tty/binding/pty.ds#L25-L61)

## Members

### `openPty(options: &'a readonly PtyOpenOptions): Result<PtyPair, HostError>`

Open one pseudo terminal pair.

### `readPty(pty: PtyHandle, buffer: &'a [uint8]): Result<uint64, HostError>`

Read bytes from one pseudo terminal controller.

### `writePty(pty: PtyHandle, buffer: &'a readonly [uint8]): Result<uint64, HostError>`

Write bytes to one pseudo terminal controller.

### `closePty(pty: PtyHandle): Result<void, HostError>`

Close one pseudo terminal controller.
