MCPcopy
hub / github.com/coder/mux / closeSession

Method closeSession

src/node/services/ptyService.ts:273–288  ·  view source on GitHub ↗

* Close a terminal session

(sessionId: string)

Source from the content-addressed store, hash-verified

271 * Close a terminal session
272 */
273 closeSession(sessionId: string): void {
274 const session = this.sessions.get(sessionId);
275 if (!session) {
276 log.info(`Cannot close terminal session ${sessionId}: not found`);
277 return;
278 }
279
280 log.info(`Closing terminal session ${sessionId}`);
281
282 if (session.pty) {
283 // Works for both local and SSH
284 session.pty.kill();
285 }
286
287 this.sessions.delete(sessionId);
288 }
289
290 /**
291 * Get all session IDs for a workspace.

Callers 3

closeAllSessionsMethod · 0.95

Calls 3

getMethod · 0.65
killMethod · 0.65
deleteMethod · 0.45

Tested by

no test coverage detected