feat(workspace-terminal): use environment shell command
This commit is contained in:
@@ -29,6 +29,17 @@ export interface IProcessHandle {
|
||||
kill(): void;
|
||||
}
|
||||
|
||||
export interface IShellCommand {
|
||||
/** Executable to start for an interactive shell session. */
|
||||
command: string;
|
||||
/** Optional command arguments. */
|
||||
args?: string[];
|
||||
/** Optional display label for terminal tabs. */
|
||||
label?: string;
|
||||
/** Optional prompt marker used for setup commands. */
|
||||
prompt?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract execution environment interface.
|
||||
* Implementations can target WebContainer (browser), Backend API (server), or Mock (testing).
|
||||
@@ -93,12 +104,18 @@ export interface IExecutionEnvironment {
|
||||
|
||||
/**
|
||||
* Spawn a new process
|
||||
* @param command - Command to run (e.g., 'jsh', 'node', 'npm')
|
||||
* @param command - Command to run (e.g., 'node', 'npm')
|
||||
* @param args - Optional arguments
|
||||
* @returns Process handle with I/O streams
|
||||
*/
|
||||
spawn(command: string, args?: string[]): Promise<IProcessHandle>;
|
||||
|
||||
/**
|
||||
* Return the environment-native interactive shell command.
|
||||
* Implementations should provide this when terminal shells need a specific executable.
|
||||
*/
|
||||
getShellCommand?(): IShellCommand | Promise<IShellCommand>;
|
||||
|
||||
// ============ Lifecycle ============
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user