(sessionId: string)
| 238 | } |
| 239 | |
| 240 | export 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 |
no test coverage detected