Skip to main content

executeCommandRunUntilInterrupt

plugin.terminal.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.

Parameters

ParameterTypeRequiredDescription
commandstringYesThe command to be executed.
executeInMainbooleanYesWhether to execute in main terminal. (default: false)

Returns

Promise<CommandError> — A promise that resolves when the command is interrupted.

Example

import plugin from '@codebolt/plugin-sdk';

const result = await plugin.terminal.executeCommandRunUntilInterrupt('command', true);
console.log(result);