()
| 228 | } |
| 229 | |
| 230 | destroy() { |
| 231 | if (this.pty) { |
| 232 | try { |
| 233 | this.pty.kill(); |
| 234 | } catch (_err) { |
| 235 | const err = _err as {stack: any}; |
| 236 | console.error('exit error', err.stack); |
| 237 | } |
| 238 | } else { |
| 239 | console.warn('Warning: Attempted to destroy a session with no pty'); |
| 240 | } |
| 241 | this.emit('exit'); |
| 242 | this.ended = true; |
| 243 | } |
| 244 | } |