(state: AppState)
| 376 | * Used to determine whether Ctrl+B should background existing tasks vs. background the session. |
| 377 | */ |
| 378 | export function hasForegroundTasks(state: AppState): boolean { |
| 379 | return Object.values(state.tasks).some(task => { |
| 380 | if (isLocalShellTask(task) && !task.isBackgrounded && task.shellCommand) { |
| 381 | return true; |
| 382 | } |
| 383 | // Exclude main session tasks - they display in the main view, not as foreground tasks |
| 384 | if (isLocalAgentTask(task) && !task.isBackgrounded && !isMainSessionTask(task)) { |
| 385 | return true; |
| 386 | } |
| 387 | return false; |
| 388 | }); |
| 389 | } |
| 390 | export function backgroundAll(getAppState: () => AppState, setAppState: SetAppState): void { |
| 391 | const state = getAppState(); |
| 392 |
no test coverage detected