MCPcopy
hub / github.com/RedPlanetHQ/core / stopProcess

Function stopProcess

packages/cli/src/utils/coding-runner.ts:240–254  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

238}
239
240export function stopProcess(sessionId: string): boolean {
241 if (ptyManager.isRunning(sessionId)) {
242 return ptyManager.kill(sessionId, 'SIGTERM');
243 }
244
245 // Legacy path: kill by stored PID if PTY manager doesn't know about it.
246 const session = getSession(sessionId);
247 if (!session?.pid) return false;
248 try {
249 process.kill(session.pid, 'SIGTERM');
250 return true;
251 } catch {
252 return false;
253 }
254}
255

Callers 3

handleAskFunction · 0.90
handleCloseSessionFunction · 0.90
handleCloseAllFunction · 0.90

Calls 3

getSessionFunction · 0.90
isRunningMethod · 0.80
killMethod · 0.80

Tested by

no test coverage detected