Skip to main content

terminal

@codebolt/codeboltjs


Variable: terminal

const terminal: {
eventEmitter: CustomEventEmitter;
executeCommand: (command: string, returnEmptyStringOnSuccess: boolean) => Promise<CommandOutput | CommandError | CommandFinish>;
executeCommandRunUntilError: (command: string, executeInMain: boolean) => Promise<CommandError>;
executeCommandRunUntilInterrupt: (command: string, executeInMain: boolean) => Promise<CommandError>;
executeCommandWithStream: CustomEventEmitter;
sendManualInterrupt: Promise<TerminalInterruptResponse>;
};

Defined in: packages/codeboltjs/src/modules/terminal.ts:30

A module for executing commands in a terminal-like environment via WebSocket.

Type Declaration

NameTypeDescriptionDefined in
eventEmitterCustomEventEmitter-packages/codeboltjs/src/modules/terminal.ts:31
executeCommand()(command: string, returnEmptyStringOnSuccess: boolean) => Promise<CommandOutput | CommandError | CommandFinish>Executes a given command and returns the result. Listens for messages from the WebSocket that indicate the output, error, or finish state of the executed command and resolves the promise accordingly.packages/codeboltjs/src/modules/terminal.ts:41
executeCommandRunUntilError()(command: string, executeInMain: boolean) => Promise<CommandError>Executes a given command and keeps running until an error occurs. Listens for messages from the WebSocket and resolves the promise when an error is encountered.packages/codeboltjs/src/modules/terminal.ts:59
executeCommandRunUntilInterrupt()(command: string, executeInMain: boolean) => Promise<CommandError>Executes a given command and keeps running until manually interrupted. Listens for messages from the WebSocket and resolves the promise when interrupted.packages/codeboltjs/src/modules/terminal.ts:78
executeCommandWithStream()(command: string, executeInMain: boolean) => CustomEventEmitterExecutes a given command and streams the output. Listens for messages from the WebSocket and streams the output data.packages/codeboltjs/src/modules/terminal.ts:111
sendManualInterrupt()() => Promise<TerminalInterruptResponse>Sends a manual interrupt signal to the terminal.packages/codeboltjs/src/modules/terminal.ts:95