(getAppState: () => AppState, setAppState: SetAppState)
| 388 | }); |
| 389 | } |
| 390 | export function backgroundAll(getAppState: () => AppState, setAppState: SetAppState): void { |
| 391 | const state = getAppState(); |
| 392 | |
| 393 | // Background all foreground bash tasks |
| 394 | const foregroundBashTaskIds = Object.keys(state.tasks).filter(id => { |
| 395 | const task = state.tasks[id]; |
| 396 | return isLocalShellTask(task) && !task.isBackgrounded && task.shellCommand; |
| 397 | }); |
| 398 | for (const taskId of foregroundBashTaskIds) { |
| 399 | backgroundTask(taskId, getAppState, setAppState); |
| 400 | } |
| 401 | |
| 402 | // Background all foreground agent tasks |
| 403 | const foregroundAgentTaskIds = Object.keys(state.tasks).filter(id => { |
| 404 | const task = state.tasks[id]; |
| 405 | return isLocalAgentTask(task) && !task.isBackgrounded; |
| 406 | }); |
| 407 | for (const taskId of foregroundAgentTaskIds) { |
| 408 | backgroundAgentTask(taskId, getAppState, setAppState); |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | /** |
| 413 | * Background an already-registered foreground task in-place. |
no test coverage detected