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

Function hasForegroundTasks

src/tasks/LocalShellTask/LocalShellTask.tsx:378–389  ·  view source on GitHub ↗
(state: AppState)

Source from the content-addressed store, hash-verified

376 * Used to determine whether Ctrl+B should background existing tasks vs. background the session.
377 */
378export 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}
390export function backgroundAll(getAppState: () => AppState, setAppState: SetAppState): void {
391 const state = getAppState();
392

Callers 1

SessionBackgroundHintFunction · 0.85

Calls 4

isLocalShellTaskFunction · 0.85
isLocalAgentTaskFunction · 0.85
isMainSessionTaskFunction · 0.85
valuesMethod · 0.80

Tested by

no test coverage detected