Skip to content

Commit 9d9f3a4

Browse files
authored
Fix spawning code-server within code-server (#4590)
* Remove extra VS Code CLI spawn We already spawn VS Code's CLI when necessary in the lines below. Having the CLI spawn unconditionally when in a VS Code environment makes it impossible to run code-server within code-server (for example to develop it). * Update VS Code This sanitizes our environment variables so code-server does not always think it is a child spawn. Fixes #4519.
1 parent c3eb9b8 commit 9d9f3a4

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

src/node/entry.ts

+1-20
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
11
import { logger } from "@coder/logger"
22
import { optionDescriptions, parse, readConfigFile, setDefaults, shouldOpenInExistingInstance } from "./cli"
3-
import { commit, pkgName, version } from "./constants"
3+
import { commit, version } from "./constants"
44
import { openInExistingInstance, runCodeServer, runVsCodeCli, shouldSpawnCliProcess } from "./main"
55
import { monkeyPatchProxyProtocols } from "./proxy_agent"
6-
import { loadAMDModule } from "./util"
76
import { isChild, wrapper } from "./wrapper"
87

9-
const cliPipe = process.env["VSCODE_IPC_HOOK_CLI"] as string
10-
const cliCommand = process.env["VSCODE_CLIENT_COMMAND"] as string
11-
128
async function entry(): Promise<void> {
139
monkeyPatchProxyProtocols()
1410

15-
if (cliPipe || cliCommand) {
16-
const remoteAgentMain = await loadAMDModule<CodeServerLib.RemoteCLIMain>("vs/server/remoteCli", "main")
17-
18-
remoteAgentMain(
19-
{
20-
productName: pkgName,
21-
version,
22-
commit,
23-
executableName: pkgName,
24-
},
25-
process.argv.slice(2),
26-
)
27-
return
28-
}
29-
3011
// There's no need to check flags like --help or to spawn in an existing
3112
// instance for the child process because these would have already happened in
3213
// the parent and the child wouldn't have been spawned. We also get the

vendor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"postinstall": "./postinstall.sh"
88
},
99
"devDependencies": {
10-
"code-oss-dev": "cdr/vscode#5e0c6f3b95ed032e62c49101ae502a46c62ef202"
10+
"code-oss-dev": "cdr/vscode#c2a251c6afaa13fbebf97fcd8a68192f8cf46031"
1111
}
1212
}

vendor/yarn.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ clone-response@^1.0.2:
296296
dependencies:
297297
mimic-response "^1.0.0"
298298

299-
code-oss-dev@cdr/vscode#5e0c6f3b95ed032e62c49101ae502a46c62ef202:
299+
code-oss-dev@cdr/vscode#c2a251c6afaa13fbebf97fcd8a68192f8cf46031:
300300
version "1.61.1"
301-
resolved "https://codeload.github.com/cdr/vscode/tar.gz/5e0c6f3b95ed032e62c49101ae502a46c62ef202"
301+
resolved "https://codeload.github.com/cdr/vscode/tar.gz/c2a251c6afaa13fbebf97fcd8a68192f8cf46031"
302302
dependencies:
303303
"@microsoft/applicationinsights-web" "^2.6.4"
304304
"@vscode/sqlite3" "4.0.12"

0 commit comments

Comments
 (0)