MCPcopy Index your code
hub / github.com/github/copilot-sdk / getForegroundSessionId

Method getForegroundSessionId

nodejs/src/client.ts:2049–2056  ·  view source on GitHub ↗

* Gets the foreground session ID in TUI+server mode. * * This returns the ID of the session currently displayed in the TUI. * Only available when connecting to a server running in TUI+server mode (--ui-server). * * @returns A promise that resolves with the foreground session

()

Source from the content-addressed store, hash-verified

2047 * ```
2048 */
2049 async getForegroundSessionId(): Promise<string | undefined> {
2050 if (!this.connection) {
2051 throw new Error("Client not connected");
2052 }
2053
2054 const response = await this.connection.sendRequest("session.getForeground", {});
2055 return (response as ForegroundSessionInfo).sessionId;
2056 }
2057
2058 /**
2059 * Sets the foreground session in TUI+server mode.

Callers 1

Calls 1

sendRequestMethod · 0.45

Tested by

no test coverage detected