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 https://github.com/cdr/code-server/issues/4519.
This commit is contained in:
@ -1,32 +1,13 @@
|
||||
import { logger } from "@coder/logger"
|
||||
import { optionDescriptions, parse, readConfigFile, setDefaults, shouldOpenInExistingInstance } from "./cli"
|
||||
import { commit, pkgName, version } from "./constants"
|
||||
import { commit, version } from "./constants"
|
||||
import { openInExistingInstance, runCodeServer, runVsCodeCli, shouldSpawnCliProcess } from "./main"
|
||||
import { monkeyPatchProxyProtocols } from "./proxy_agent"
|
||||
import { loadAMDModule } from "./util"
|
||||
import { isChild, wrapper } from "./wrapper"
|
||||
|
||||
const cliPipe = process.env["VSCODE_IPC_HOOK_CLI"] as string
|
||||
const cliCommand = process.env["VSCODE_CLIENT_COMMAND"] as string
|
||||
|
||||
async function entry(): Promise<void> {
|
||||
monkeyPatchProxyProtocols()
|
||||
|
||||
if (cliPipe || cliCommand) {
|
||||
const remoteAgentMain = await loadAMDModule<CodeServerLib.RemoteCLIMain>("vs/server/remoteCli", "main")
|
||||
|
||||
remoteAgentMain(
|
||||
{
|
||||
productName: pkgName,
|
||||
version,
|
||||
commit,
|
||||
executableName: pkgName,
|
||||
},
|
||||
process.argv.slice(2),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// There's no need to check flags like --help or to spawn in an existing
|
||||
// instance for the child process because these would have already happened in
|
||||
// the parent and the child wouldn't have been spawned. We also get the
|
||||
|
Reference in New Issue
Block a user