(sessionId: string, signal: string = 'SIGTERM')
| 300 | } |
| 301 | |
| 302 | kill(sessionId: string, signal: string = 'SIGTERM'): boolean { |
| 303 | const handle = this.handles.get(sessionId); |
| 304 | if (!handle) return false; |
| 305 | try { |
| 306 | handle.cancelled = true; |
| 307 | handle.pty.kill(signal); |
| 308 | return true; |
| 309 | } catch { |
| 310 | return false; |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | /** |
| 315 | * Kill a session and wait for the OS to reap the PTY (so a follow-up `spawn` |
no test coverage detected