Skip to content

terminals.start

Starts an interactive PTY session in a workspace (TRM-100).

/** `terminals.start` params (TRM-100). */
export type StartTerminalParams = {
cols: number;
/** Run as `sh -c <command>` attached to a PTY. */
command: string;
/** Workspace-relative directory; omitted means the workspace folder. */
cwd?: string | null;
rows: number;
workspaceId: string;
};
/** An interactive PTY session (TRM-100). */
export type TerminalInfo = {
cols: number;
/** Run as `sh -c <command>` attached to a PTY. */
command: string;
/** Absolute working directory selected under the workspace. */
cwd: string;
id: string;
rows: number;
startedAt: number;
status: TerminalStatus;
workspaceId: string;
};
/** The process state of a daemon-owned PTY session (TRM-100). */
export type TerminalStatus =
| {
state: "running";
}
/** The shell exited; PTY output is still available in the topic snapshot. */
| {
code?: number | null;
endedAt: number;
state: "exited";
};