* 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
()
| 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. |
no test coverage detected