Karagöz

ProcessTabContext

type ProcessTabContext = object;

Context information for a process / terminal tab.

Type declaration

args?

optional args: string[];

Arguments to be passed to WebContainer.spawn().

canRestart?

optional canRestart: boolean;

When true, a restart icon will appear next to the label and the process can be restarted. Ignored when isTerminal: true.

canStop?

optional canStop: boolean;

When true, a restart icon will appear next to the label and the process can be stopped. Ignored when isTerminal: true.

command

command: string;

Command to be passed to WebContainer.spawn().

exitCode?

optional exitCode: number;

Exit code of the finished / terminated process.

isHidden?

optional isHidden: boolean;

When true, the process will run in the background and will not be shown in the tab list.

isTerminal?

optional isTerminal: boolean;

When true, the process is treated as a terminal: some flags are ignored and the tab will be shown in the terminals panel and not in the processes panel.

logs?

optional logs: string[];

Used to persist the logs and re-fill xterm when the tab is closed and re-opened.

process?

optional process: WebContainerProcess;

The process instance.

processInputHandler()?

optional processInputHandler: (chunk?) => Promise<void>;

Input handler, needed to accept input in xterm and pass it to the process in the web container.

Parameters

chunk?

string

Returns

Promise<void>

processOutputHandler()?

optional processOutputHandler: (data) => void;

Output handler, needed to read and store the logs to be displayed by xterm.

Parameters

data

string

Returns

void

suppressClose?

optional suppressClose: boolean;

When true, the close icon next to the tab label will be omitted.

suppressInput?

optional suppressInput: boolean;

When true, xterm will not accept user input.

Defined in

packages/sandbox/src/types/Tabs.ts:38