createCustomTerminal

Create a custom terminal emulator with specified dimensions and output handling

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

Parameters

  • opts (object) - Terminal 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 which is resolved when the terminal has been created successfully. The promise resolves to a Terminal 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.