MCPcopy Create free account
hub / github.com/Facets-cloud/flow / IsBackground

Function IsBackground

internal/spawner/spawner.go:63–68  ·  view source on GitHub ↗

IsBackground reports whether flow should spawn this session as a terminal-free background agent ($FLOW_TERM=bg) rather than opening a terminal tab. bg mode is NOT a terminal backend — it bypasses SpawnTab entirely (see do.go's bg branch), so it lives in its own predicate rather than as a Detect() ca

()

Source from the content-addressed store, hash-verified

61// rather than as a Detect() case. The match is exact and case-sensitive,
62// mirroring Detect's $FLOW_TERM handling.
63func IsBackground() bool {
64 if BackgroundOverride != nil {
65 return *BackgroundOverride
66 }
67 return os.Getenv("FLOW_TERM") == "bg"
68}
69
70// Detect returns the backend that SpawnTab will use for the current
71// process environment. Exposed so callers (and tests) can inspect the

Callers 5

cmdDoFunction · 0.92
liveSessionsForTasksFunction · 0.92
bgAgentStatusFunction · 0.92
TestIsBackgroundFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestIsBackgroundFunction · 0.68