MCPcopy
hub / github.com/pingdotgg/t3code / close

Function close

apps/server/src/terminal/Manager.ts:2588–2608  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

2586 );
2587
2588 const close: TerminalManager["Service"]["close"] = (input) =>
2589 withThreadLock(
2590 input.threadId,
2591 Effect.gen(function* () {
2592 if (input.terminalId) {
2593 yield* closeSession(input.threadId, input.terminalId, input.deleteHistory === true);
2594 return;
2595 }
2596
2597 const threadSessions = yield* sessionsForThread(input.threadId);
2598 yield* Effect.forEach(
2599 threadSessions,
2600 (session) => closeSession(input.threadId, session.terminalId, false),
2601 { discard: true },
2602 );
2603
2604 if (input.deleteHistory) {
2605 yield* deleteAllHistoryForThread(input.threadId);
2606 }
2607 }),
2608 );
2609
2610 return TerminalManager.of({
2611 open,

Callers

nothing calls this directly

Calls 2

sessionsForThreadFunction · 0.85
withThreadLockFunction · 0.70

Tested by

no test coverage detected