diff --git a/lib/terminal-session.js b/lib/terminal-session.js index 1cb8c7e..9065905 100644 --- a/lib/terminal-session.js +++ b/lib/terminal-session.js @@ -91,7 +91,15 @@ export default class TerminalSession { destroy() { // Kill the Pseudoterminal (pty) Process - if (this.pty) this.pty.kill(); + if (this.pty) { + try { + this.pty.kill(); + } catch (e) { + if (e.message !== 'Pty seems to have been killed already') { + throw e; + } + } + } // Destroy the Terminal Instance if (this.xterm) this.xterm.destroy();