MCPcopy Index your code
hub / github.com/coder/code-server / _start

Method _start

src/node/wrapper.ts:308–334  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

306 }
307
308 private async _start(): Promise<void> {
309 const child = this.spawn()
310 this.child = child
311
312 // Log child output to stdout/stderr and to the log directory.
313 if (child.stdout) {
314 child.stdout.on("data", (data) => {
315 this.logStdoutStream.write(data)
316 process.stdout.write(data)
317 })
318 }
319 if (child.stderr) {
320 child.stderr.on("data", (data) => {
321 this.logStderrStream.write(data)
322 process.stderr.write(data)
323 })
324 }
325
326 this.logger.debug(`spawned child process ${child.pid}`)
327
328 await this.handshake(child)
329
330 child.once("exit", (code) => {
331 this.logger.debug(`inner process ${child.pid} exited unexpectedly`)
332 this.exit(code || 0)
333 })
334 }
335
336 private spawn(): cp.ChildProcess {
337 return cp.fork(path.join(__dirname, "entry"), {

Callers 2

relaunchMethod · 0.95
startMethod · 0.95

Calls 4

spawnMethod · 0.95
handshakeMethod · 0.95
writeMethod · 0.80
onceMethod · 0.80

Tested by

no test coverage detected