Skip to content

Commit 443f5a2

Browse files
allow running commands as global session
1 parent e334e4e commit 443f5a2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codesandbox/sdk",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "The CodeSandbox SDK",
55
"author": "CodeSandbox",
66
"license": "MIT",

src/sessions/WebSocketSession/commands.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export type ShellRunOpts = {
1010
name?: string;
1111
env?: Record<string, string>;
1212
cwd?: string;
13+
/**
14+
* Run the command in the global session instead of the current session. This makes
15+
* any environment variables available to all users of the Sandbox.
16+
*/
17+
asGlobalSession?: boolean;
1318
};
1419

1520
export type CommandStatus =
@@ -60,7 +65,7 @@ export class Commands {
6065
this.pitcherClient.workspacePath,
6166
opts?.dimensions ?? DEFAULT_SHELL_SIZE,
6267
commandWithEnv,
63-
"TERMINAL",
68+
opts?.asGlobalSession ? "COMMAND" : "TERMINAL",
6469
true
6570
);
6671

0 commit comments

Comments
 (0)