MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / backgroundAll

Function backgroundAll

src/tasks/LocalShellTask/LocalShellTask.tsx:430–450  ·  view source on GitHub ↗
(getAppState: () => AppState, setAppState: SetAppState)

Source from the content-addressed store, hash-verified

428}
429
430export function backgroundAll(getAppState: () => AppState, setAppState: SetAppState): void {
431 const state = getAppState();
432
433 // Background all foreground bash tasks
434 const foregroundBashTaskIds = Object.keys(state.tasks).filter(id => {
435 const task = state.tasks[id];
436 return isLocalShellTask(task) && !task.isBackgrounded && task.shellCommand;
437 });
438 for (const taskId of foregroundBashTaskIds) {
439 backgroundTask(taskId, getAppState, setAppState);
440 }
441
442 // Background all foreground agent tasks
443 const foregroundAgentTaskIds = Object.keys(state.tasks).filter(id => {
444 const task = state.tasks[id];
445 return isLocalAgentTask(task) && !task.isBackgrounded;
446 });
447 for (const taskId of foregroundAgentTaskIds) {
448 backgroundAgentTask(taskId, getAppState, setAppState);
449 }
450}
451
452/**
453 * Background an already-registered foreground task in-place.

Callers 2

BackgroundHintFunction · 0.85
SessionBackgroundHintFunction · 0.85

Calls 6

isLocalShellTaskFunction · 0.85
backgroundTaskFunction · 0.85
isLocalAgentTaskFunction · 0.85
backgroundAgentTaskFunction · 0.85
keysMethod · 0.65
getAppStateFunction · 0.50

Tested by

no test coverage detected