vscode: Terminal pty host unresponsive after closing a VS Code window

I’ve seen this happen a few times now, and this last time it seemed to happen right after I closed a VS Code window. After that, I got the following notification in all my other open VS Code windows.

image

Here is the Shared Process output

[2021-03-02 03:11:02.588] [sharedprocess] [warning] No ptyHost heartbeat after 6 seconds
[2021-03-02 03:11:07.592] [sharedprocess] [error] No ptyHost heartbeat after 12 seconds
[2021-03-02 03:11:40.245] [sharedprocess] [error] [uncaught exception in sharedProcess]: Could not find pty with id "4": Error: Could not find pty with id "4"
    at P._throwIfNoPty (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:12:36591)
    at P.shutdown (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:12:35103)
    at Object.call (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:11:8178)
    at C.onPromise (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:27579)
    at C.onRawMessage (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:26938)
    at c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:26191
    at A.fire (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:8:1836)
    at process.Z (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:6:30611)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
[2021-03-02 03:11:40.303] [sharedprocess] [error] [uncaught exception in sharedProcess]: Could not find pty with id "2": Error: Could not find pty with id "2"
    at P._throwIfNoPty (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:12:36591)
    at P.resize (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:12:35219)
    at Object.call (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:11:8178)
    at C.onPromise (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:27579)
    at C.onRawMessage (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:26938)
    at c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:26191
    at A.fire (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:8:1836)
    at process.Z (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:6:30611)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)
[2021-03-02 03:11:40.838] [sharedprocess] [error] [uncaught exception in sharedProcess]: Could not find pty with id "2": Error: Could not find pty with id "2"
    at P._throwIfNoPty (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:12:36591)
    at P.shutdown (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:12:35103)
    at Object.call (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:11:8178)
    at C.onPromise (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:27579)
    at C.onRawMessage (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:26938)
    at c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:10:26191
    at A.fire (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:8:1836)
    at process.Z (c:\Users\Eric\AppData\Local\Programs\Microsoft VS Code Insiders\resources\app\out\vs\platform\terminal\node\ptyHostMain.js:6:30611)
    at process.emit (events.js:315:20)
    at emit (internal/child_process.js:876:12)
    at processTicksAndRejections (internal/process/task_queues.js:85:21)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 9
  • Comments: 24 (11 by maintainers)

Commits related to this issue

Most upvoted comments

VSCode 1.55.0, the issue is still there.

Single instance of VSCode looks fine, but starting another instance fires the warning almost immediately, breaking terminals in both instances.

for me, even single instanse of vscode show this message, if i want to restart “watch” task

@RomanDavlyatshin the new release which fixes this should be out next week.

I’m getting this error all the time since some months. If I start an npm script in VS Code this error occurs. So I had to switch to the git bash terminal (Windows). Hope this gets fixed… Still happens with 1.56.0

Started getting this error in VSCode 1.55.2 after upgrading to Chrome OS v90; appears to cause the whole VM to seize. Persists after full powerwash & fresh VM/Code install, no exts enabled. 😦

UPDATE: FWIW, I have not experienced the issue on Chrome OS Version 90.0.4430.100 since updating to Code v1.56.0

I had the problem even with uninstalled extensions. But the good old “did you try turning it off an on again” helped. After a windows reboot, everything works fine

@SFeldman-Accenture this should be fixed in the Insiders build as of today, coming to stable in a month or so.

I get this all the time even in the Insiders build and with no extensions. It started for me right after updating to macOS Big Sur v11.4

@SFeldman-Accenture yes it is, you may get some instability but also access to new fixes/features. But this issue is fixed (finally), it just won’t be available in stable until early next month.

Don’t know if this helps, but I’ve noticed that it consistently happens if I open a terminal in 2nd level (is that the vscode term for running vscode “inside” vscode?), after closing that 2nd level all terminals are stuck.

It did not happened with git console but happens a lot with powershell but git has this other problem https://stackoverflow.com/questions/62685569/error-while-installing-python-extensions-cant-open-file-directory-filename .