Skip to main content

OwnedTerminal

interface

A terminal owned by the current mod. Only owned terminals can be closed.

interface OwnedTerminal

Import

import { OwnedTerminal } from '@modular/sdk';

Members17

commands
ReadonlySignal<readonly TerminalCommandRecord[]>

Every command the host has detected, in order. Populated once output is being read through data, onCommand, or content.

exit
ReadonlySignal<TerminalExitState>

Whether the shell behind the terminal is still running; host truth.

id
TerminalId
key
TerminalOwnershipKey
state
ReadonlySignal<TerminalReferenceState>
clear()
() => Promise<void | TerminalError>
close()
() => Promise<void | TerminalError>
content()
() => Promise<TerminalContent | TerminalError>

The host's bounded scrollback and command parts. Requires `read-terminal-output`.

data()
(listener: (chunk: string) => void) => Disposable

Raw output chunks as the host emits them. Requires `read-terminal-output`.

execute()
(command: string, options?: TerminalOperationOptions) => Promise<TerminalCommandResult | TerminalError>

Run one shell command and resolve from the host shell lifecycle.

onCommand()
(listener: (event: TerminalOutputEvent) => void) => Disposable

A command started or finished on the host. Requires `read-terminal-output`.

paste()
(text: string, options?: { readonly submit?: boolean; }) => Promise<void | TerminalError>
rename()
(name: string) => Promise<void | TerminalError>
resize()
(cols: number, rows: number) => Promise<void | TerminalError>
reveal()
(focus?: 'focus' | 'preserve-focus') => Promise<void | TerminalError>
submit()
(text: string) => Promise<void | TerminalError>
write()
(text: string) => Promise<void | TerminalError>