(input)
| 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, |
nothing calls this directly
no test coverage detected