Skip to content

Commit 944c6a4

Browse files
chapterjasonclaude
andcommitted
Honor WEB_SHELL_CWD env var for new shell cwd
Lets deployers (e.g. the Coder module) point new sessions at a specific working directory without needing to pass cwd through the create-session API. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 688790f commit 944c6a4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-shell",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"private": true,
55
"type": "module",
66
"main": "server/dist/index.js",

server/src/utils/shell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export function defaultShell(): string {
55
}
66

77
export function defaultCwd(): string {
8-
return process.env["HOME"] ?? process.cwd();
8+
return process.env["WEB_SHELL_CWD"] ?? process.env["HOME"] ?? process.cwd();
99
}

0 commit comments

Comments
 (0)