---
title: "createCustomTerminal"
source: "https://browserpod.io/docs/reference/BrowserPod/createCustomTerminal"
---

# createCustomTerminal

Create a custom terminal emulator with specified dimensions and output handling

```ts
class BrowserPod {
  createCustomTerminal(opts: {
    cols?: number;
    rows?: number;
    onOutput: (buffer: Uint8Array, vt?: number) => void;
  }): Promise<Terminal>;
}
```

## Parameters

- **opts (_object_)** - [Terminal](https://browserpod.io/docs/reference/Terminal.md) configuration options passed as an object.

## Options

- **cols (`number`, _optional_)** - The number of columns (width) for the terminal display. Defaults to 80.
- **rows (`number`, _optional_)** - The number of rows (height) for the terminal display. Defaults to 24.
- **onOutput (`function(buffer: Uint8Array, vt?: number) => void`)** - Callback function invoked whenever the terminal produces output. The buffer contains the raw terminal data, and vt is the ID of the terminal that produced it.

## Returns

`createCustomTerminal` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which is resolved when the terminal has been created successfully. The promise resolves to a [Terminal](https://browserpod.io/docs/reference/Terminal.md) object.

## Notes

The `onOutput` callback is required and will be called each time data is written to the terminal. This allows you to process or display terminal output as needed.
