MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / handleKill

Function handleKill

projects/electron/src/modules/code/pty.ts:282–306  ·  view source on GitHub ↗
(params: KillParams)

Source from the content-addressed store, hash-verified

280}
281
282async function handleKill(params: KillParams): Promise<{ ok: boolean }> {
283 logger.info("[Pty:kill] Killing PTY", JSON.stringify({ ptyId: params.ptyId }))
284
285 const p = activePtys.get(params.ptyId)
286 if (!p) {
287 return { ok: false }
288 }
289
290 try {
291 if (!p.exited) {
292 p.pty.kill()
293 }
294
295 if (p.cleanupTimeoutId) {
296 clearTimeout(p.cleanupTimeoutId)
297 }
298 activePtys.delete(params.ptyId)
299 emitLifecycle({ type: "killed", ptyId: params.ptyId })
300
301 return { ok: true }
302 } catch (error) {
303 logger.error("[Pty:kill] Error:", error)
304 return { ok: false }
305 }
306}
307
308export async function spawnRuntimePty(params: SpawnParams): Promise<SpawnResponse> {
309 return handleSpawn(params)

Callers 1

killRuntimePtyFunction · 0.70

Calls 5

errorMethod · 0.80
emitLifecycleFunction · 0.70
getMethod · 0.65
killMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected