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

Function FocusSession

internal/spawner/spawner.go:140–151  ·  view source on GitHub ↗

FocusSession tries to focus an existing tab/pane that is already running the named harness binary with the given session UUID. The `binary` arg is the harness's executable name (e.g. "claude", "codex", "gemini") — backends use it to filter the process table down to relevant rows. Returns (true, nil)

(sessionID, binary string)

Source from the content-addressed store, hash-verified

138// - Terminal.app: pid → tty via ps, then osascript walk
139// - iTerm2 (default): pid → tty via ps, then osascript walk
140func FocusSession(sessionID, binary string) (bool, error) {
141 switch Detect() {
142 case BackendZellij:
143 return zellij.FocusSession(sessionID, binary)
144 case BackendKitty:
145 return kitty.FocusSession(sessionID, binary)
146 case BackendTerminal:
147 return terminal.FocusSession(sessionID, binary)
148 default:
149 return iterm.FocusSession(sessionID, binary)
150 }
151}
152
153// ShellQuote is re-exported so callers don't need to import the chosen
154// backend just to quote a value before handing it to SpawnTab. All

Callers 5

cmdDoFunction · 0.92

Calls 5

FocusSessionFunction · 0.92
FocusSessionFunction · 0.92
FocusSessionFunction · 0.92
FocusSessionFunction · 0.92
DetectFunction · 0.85