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

Function FocusSession

internal/iterm/iterm.go:100–112  ·  view source on GitHub ↗

FocusSession tries to focus the iTerm2 session whose underlying process is `binary` running with `--session-id ` or `--resume ` (or any flag carrying the UUID). The `binary` arg is the harness's executable name (e.g. "claude", "codex", "gemini") used to filter ps rows. Returns

(sessionID, binary string)

Source from the content-addressed store, hash-verified

98// controlling tty, then drive osascript to walk every window/tab/
99// session and select the one whose `tty` property matches.
100func FocusSession(sessionID, binary string) (bool, error) {
101 if sessionID == "" {
102 return false, nil
103 }
104 tty, err := ttyForHarnessSession(sessionID, binary)
105 if err != nil {
106 return false, err
107 }
108 if tty == "" {
109 return false, nil
110 }
111 return focusByTTY(tty)
112}
113
114// sessionUUIDRowRe matches a `ps` line carrying a session UUID via
115// `--session-id <uuid>` or `--resume <uuid>`. Paired with a binary-

Calls 2

ttyForHarnessSessionFunction · 0.70
focusByTTYFunction · 0.70