jsmecham / atom-terminal-tab

Simple terminal for the Atom text editor.
https://atom.io/packages/terminal-tab
MIT License
142 stars 29 forks source link

Uncaught Error: Pty seems to have been killed already #84

Open lamba92 opened 6 years ago

lamba92 commented 6 years ago

[Enter steps to reproduce:]

I just closed the terminal tab while an application was opened (SWI-PL).

Atom: 1.26.0 x64 Electron: 1.7.11 OS: Unknown Windows version Thrown From: terminal-tab package 0.5.6

Stack Trace

Uncaught Error: Pty seems to have been killed already

At C:\Users\lamba\.atom\packages\terminal-tab\node_modules\node-pty-prebuilt\lib\windowsPtyAgent.js:83

Error: Pty seems to have been killed already
    at WindowsPtyAgent.kill (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsPtyAgent.js:83:13)
    at /packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:144:26)
    at WindowsTerminal._defer (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:155:24)
    at WindowsTerminal.kill (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:139:14)
    at TerminalSession.destroy (/packages/terminal-tab/lib/terminal-session.js:94:28)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at WindowsTerminal.Terminal.emit (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/terminal.js:79:34)
    at /packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:94:23)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at Pipe._handle.close [as _onclose] (net.js:510:12)

Commands

     -3:40.3.0 editor:newline (input.hidden-input)
  3x -3:39.1.0 core:backspace (input.hidden-input)
     -3:36.8.0 autocomplete-plus:cancel (input.hidden-input)
     -3:11.6.0 core:move-left (input.hidden-input)
     -3:10.7.0 editor:newline (input.hidden-input)
     -3:07.9.0 core:move-left (input.hidden-input)
     -3:06.8.0 editor:newline (input.hidden-input)
  4x -3:06.1.0 core:backspace (input.hidden-input)
     -2:37.5.0 intentions:highlight (input.hidden-input)
     -2:37.3.0 core:save (input.hidden-input)
     -2:33.9.0 terminal:open (atom-text-editor.editor.is-focused)
     -1:02.6.0 core:move-up (input.hidden-input)
  2x -0:36.7.0 core:backspace (input.hidden-input)
     -0:35.7.0 core:move-left (input.hidden-input)
     -0:34.3.0 intentions:highlight (input.hidden-input)
     -0:34.1.0 core:save (input.hidden-input)

Non-Core Packages

busy-signal 1.4.3 
darcula-syntax 0.2.1 
fancy-bracket-matcher 2.1.0 
highlight-selected 0.13.1 
intentions 1.1.5 
language-clingo 0.1.1 
language-clips 0.3.1 
language-prolog 0.11.0 
linter 2.2.0 
linter-prolog 0.2.0 
linter-ui-default 1.7.1 
terminal-tab 0.5.6 
title-bar-replacer 1.8.1 
SReject commented 6 years ago

Getting this error as well. It can also lead to a side effect of causing atom to reset config.cson, thus losing all custom settings upon restart

kostadinnm commented 6 years ago

I'm getting this when I do the following sequence: 1)close a project folder: closing 2)open folder: opening

I can confirm that I've been losing my settings in the past, but since I utilize a package called "sync settings" am able to restore them.

ignaciosiri commented 6 years ago

Getting this as well, every time i close the terminal tab, either running something or not.

`

  1. Open new terminal tab (Ctrl + Shift + T) (Custom keyboard binding).
  2. Close terminal tab.

Atom: 1.28.0 x64 Electron: 2.0.3 OS: Unknown Windows version Thrown From: terminal-tab package 0.5.7

Stack Trace

Uncaught Error: Pty seems to have been killed already

At C:\Users\isiri\.atom\packages\terminal-tab\node_modules\node-pty-prebuilt\lib\windowsPtyAgent.js:83

Error: Pty seems to have been killed already
    at WindowsPtyAgent.kill (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsPtyAgent.js:83:13)
    at /packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:144:26)
    at WindowsTerminal._defer (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:155:24)
    at WindowsTerminal.kill (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:139:14)
    at TerminalSession.destroy (/packages/terminal-tab/lib/terminal-session.js:94:28)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at WindowsTerminal.Terminal.emit (/packages/terminal-tab/node_modules/node-pty-prebuilt/lib/terminal.js:79:34)
    at /packages/terminal-tab/node_modules/node-pty-prebuilt/lib/windowsTerminal.js:94:23)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)

Commands

     -1:40.4.0 core:save (input.hidden-input)
     -1:39.3.0 core:undo (input.hidden-input)
     -1:38.5.0 core:delete (input.hidden-input)
     -1:38.3.0 core:save (input.hidden-input)
     -1:31.7.0 core:delete (input.hidden-input)
  2x -1:31.1.0 core:move-up (input.hidden-input)
     -1:30.5.0 core:move-down (input.hidden-input)
  2x -1:30.3.0 core:select-up (input.hidden-input)
     -1:29.8.0 core:delete (input.hidden-input)
     -1:28.9.0 core:undo (input.hidden-input)
  2x -1:28.3.0 core:select-left (input.hidden-input)
     -1:27.8.0 core:delete (input.hidden-input)
 25x -1:27.2.0 core:move-up (input.hidden-input)
     -1:24.9.0 core:move-down (input.hidden-input)
     -1:24.3.0 core:save (input.hidden-input)
     -0:15.4.0 terminal:open (input.hidden-input)

Non-Core Packages

atom-beautify 0.32.5 
atom-bootstrap3 1.2.12 
autocomplete-ruby 0.2.8 
file-icons 2.1.22 
jquery-snippets 11.0.0 
rails-snippets 2.19.0 
ruby-block 0.3.6 
terminal-tab 0.5.7 

`

SReject commented 6 years ago

Not sure if its the correct solution, but in %USERPROFILE%/.atom/packages/terminal-tab/lib/terminal-session.js I replace line 94 with

    if (this.pty) {
        try {
            this.pty.kill();
        } catch (e) {
            if (e.message !== 'Pty seems to have been killed already') {
                throw e;
            }
        }
    }
xavierfoucrier commented 6 years ago

Got the same issue too, every time I close the terminal, Atom 1.28.2.

xavierfoucrier commented 4 years ago

Still an issue in Atom 1.51. Can you please @jsmecham take a look at PR https://github.com/jsmecham/atom-terminal-tab/pull/116?

Thanks a lot :wink: