MCPcopy Index your code
hub / github.com/codeaashu/claude-code / spawnBackgroundTask

Function spawnBackgroundTask

src/tools/BashTool/BashTool.tsx:904–921  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

902
903 // Helper to spawn a background task and return its ID
904 async function spawnBackgroundTask(): Promise<string> {
905 const handle = await spawnShellTask({
906 command,
907 description: description || command,
908 shellCommand,
909 toolUseId,
910 agentId
911 }, {
912 abortController,
913 getAppState: () => {
914 // We don't have direct access to getAppState here, but spawn doesn't
915 // actually use it during the spawn process
916 throw new Error('getAppState not available in runShellCommand context');
917 },
918 setAppState
919 });
920 return handle.taskId;
921 }
922
923 // Helper to start backgrounding with optional logging
924 function startBackgrounding(eventName: string, backgroundFn?: (shellId: string) => void): void {

Callers 2

startBackgroundingFunction · 0.70
runShellCommandFunction · 0.70

Calls 1

spawnShellTaskFunction · 0.85

Tested by

no test coverage detected