terminal/TerminalSurface
import { … } from 'zidane-ui/terminal'ui/src/terminal/TerminalSurface.tsx
Components#
TerminalSurfaceComponent#
Renders the terminal (see the module comment), with a notice when ghostty-web fails to load or the process exits.
function TerminalSurface(props: TerminalSurfaceProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | TerminalSurfaceProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| adapter | TerminalAdapter | The process to show; a new adapter re-creates the terminal. |
| autoFocus? | boolean | Take keyboard focus on mount and whenever the view becomes visible. |
| className? | string | Extra classes on the host (it already flexes to fill its parent). |
| fontFamily | string | CSS font family of the grid; applies live. |
| fontSize | number | Font size in px; applies live. |
| label? | string | Accessible name. Default: the |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| symbolsFontUrl? | string | Where the app serves the Nerd Font symbols face (see |
| theme | TerminalTheme | Colors ( |
| visible? | boolean | Shown and laid out; off pauses rendering (a background tab). |
Interfaces#
TerminalAdapterInterface#
The process a TerminalSurface shows.
interface TerminalAdapterProperties
| Name | Type | Description |
|---|---|---|
| onData | (listener: (data: string) => void) => () => void | The process's output; returns the unsubscribe. |
| onExit? | (listener: (code: number) => void) => () => void | The process ended; returns the unsubscribe. |
| resize | (cols: number, rows: number) => void | The grid the view fits, on mount and on every change. |
| write | (data: string) => void | Typed keys and pasted text, as the bytes the process reads. |
TerminalSurfacePropsInterface#
Props of TerminalSurface.
interface TerminalSurfacePropsProperties
| Name | Type | Description |
|---|---|---|
| adapter | TerminalAdapter | The process to show; a new adapter re-creates the terminal. |
| autoFocus? | boolean | Take keyboard focus on mount and whenever the view becomes visible. |
| className? | string | Extra classes on the host (it already flexes to fill its parent). |
| fontFamily | string | CSS font family of the grid; applies live. |
| fontSize | number | Font size in px; applies live. |
| label? | string | Accessible name. Default: the |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| symbolsFontUrl? | string | Where the app serves the Nerd Font symbols face (see |
| theme | TerminalTheme | Colors ( |
| visible? | boolean | Shown and laid out; off pauses rendering (a background tab). |