feat(workspace-terminal): use environment shell command

This commit is contained in:
2026-05-25 06:13:11 +00:00
parent 0eb4611ea6
commit fed3247eea
8 changed files with 1492 additions and 877 deletions
@@ -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 ============
/**