MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / background

Method background

source code/utils/ShellCommand.ts:351–368  ·  view source on GitHub ↗
(taskId: string)

Source from the content-addressed store, hash-verified

349 }
350
351 background(taskId: string): boolean {
352 if (this.#status === 'running') {
353 this.#backgroundTaskId = taskId
354 this.#status = 'backgrounded'
355 this.#cleanupListeners()
356 if (this.taskOutput.stdoutToFile) {
357 // File mode: child writes directly to the fd with no JS involvement.
358 // The foreground timeout is gone, so watch file size to prevent
359 // a stuck append loop from filling the disk (768GB incident).
360 this.#startSizeWatchdog()
361 } else {
362 // Pipe mode: spill the in-memory buffer so readers can find it on disk.
363 this.taskOutput.spillToDisk()
364 }
365 return true
366 }
367 return false
368 }
369
370 cleanup(): void {
371 this.#stdoutWrapper?.cleanup()

Callers 4

executeInBackgroundFunction · 0.45
spawnShellTaskFunction · 0.45
backgroundTaskFunction · 0.45

Calls 3

#cleanupListenersMethod · 0.95
#startSizeWatchdogMethod · 0.95
spillToDiskMethod · 0.80

Tested by

no test coverage detected