vscode: Connection to terminal's pty host process is becoming unresponsive

Issue Type: Bug

After updating to latest VSCode stable (1.59) I started encountering an error when running tasks (The connection to the terminal’s pty host process is unresponsive, the terminals may stop working.). This used to work fine on 1.58.2 and I confirmed that it is broken on latest insider build too (1.60.0)

I have a bunch of VSCode tasks for ‘orchestrating’ local docker setup, so I can run some commands to run builds and generate TypeScript clients directly from the UI. When I run tasks without any “dependsOn” tasks they run fine. If one task depends on single other task, it also runs fine. I have problems when single task have multiple entries in “dependsOn” section - it usually works fine for the first time after I open VSCode but then the issue happens and I have to fully restart VSCode to make it work again.

VS Code version: Code - Insiders 1.60.0-insider (49af1cbe00271ac2ea36cfc5f7352fe31a7b0094, 2021-08-06T06:41:50.275Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 9 3900X 12-Core Processor (24 x 3800)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.93GB (18.13GB free)
Process Argv –crash-reporter-id 99c6e3ee-c17a-4f3a-a118-c9cbac23e0db
Screen Reader no
VM 0%
Extensions (1)
Extension Author (truncated) Version
csharp ms- 1.23.14
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30291494
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30291487
pythontb:30258533
pythonvspyt551:30291412
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
pythonvsuse255:30319630
vscod805:30301674
pythonvspyt200:30323110
vsccppwt:30312692
pythonvssor306:30340298
bridge0708:30335490
pygetstartedt2:30348854
dockerwalkthru:30348713

Tasks hierarchy
{
      "label": "[Debug] Create base image for Api container",
      "command": "powershell",
      "args": [
        "docker",
        "build",
        "--rm",
        "-f",
        "${workspaceFolder}/BaseImage.Debug.Dockerfile",
        "-t",
        "baseimage-api-debug:latest",
        "."
      ]
    },
    {
      "label": "[Debug] Create image for Api.Dockerfile",
      "command": "powershell",
      "args": [
        "docker",
        "build",
        "--rm",
        "-f",
        "${workspaceFolder}/Api.Dockerfile",
        "-t",
        "backend-core-debug:latest",
        "."
      ],
      "problemMatcher": {
        "base": "$msCompile",
        "fileLocation": [
          "relative",
          "${workspaceRoot}"
        ]
      },
      "dependsOn": [
        "[Debug] Create base image for Api container"
      ]
    },
    {
      "label": "[Debug] Create image for Hangfire.Server.Dockerfile",
      "command": "powershell",
      "args": [
        "docker",
        "build",
        "--rm",
        "-f",
        "${workspaceFolder}/Hangfire.Server.Dockerfile",
        "-t",
        "hangfire-server-debug:latest",
        "."
      ],
      "problemMatcher": {
        "base": "$msCompile",
        "fileLocation": [
          "relative",
          "${workspaceRoot}"
        ]
      },
      "dependsOn": [
        "[Debug] Create base image for Api container"
      ]
    },
    {
      "label": "[Debug] Create service for docker-compose.dev.yml",
      "command": "powershell",
      "args": [
        "docker-compose",
        "-f",
        "${workspaceFolder}/docker-compose.dev.yml",
        "up",
        "-d",
        "--build",
        "--force-recreate",
        "--renew-anon-volumes"
      ],
      "problemMatcher": "$msCompile",
      "dependsOn": [
        "[Debug] Create image for Api.Dockerfile", 
        "[Debug] Create image for Hangfire.Server.Dockerfile"
      ]
    },
    {
      "label": "[TS] generate libraries",
      "type": "shell",
      "command": "\"${workspaceRoot}/../_scripts/wait-for-it-http.ps1\" && nswag.cmd run || docker logs backend-core_api_1",
      "problemMatcher": "$msCompile",
      "options": {
        "cwd": "${workspaceRoot}/../tt-ts-core"
      },
      "dependsOn": [
        "[Debug] Create service for docker-compose.dev.yml"
      ]
    }

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 15
  • Comments: 87 (19 by maintainers)

Commits related to this issue

Most upvoted comments

pty

"terminal.integrated.windowsEnableConpty": false

restart vs code …

I’ve closed this out with the following changes:

I also spotted a few other issues with slow pty hosts which I’ll look into if time allows this release: https://github.com/microsoft/vscode/issues/185254, https://github.com/microsoft/vscode/issues/185256, https://github.com/microsoft/vscode/issues/185257


Note that this is actioning the most recent issue, not longer standing problems. This issue has been a bit of a dumping ground for all the problems so it’s probably best to hit the reset button and create a new issue if there are remaining issues after all the changes that have gone in recently.

Every time I wake my mac up from sleep (since the latest update to 1.59.1) I get this too:

image

A lot of times all the terminal processes are still running too, so I have to open Activity Monitor to force close them.

This is a pretty breaking change making vscode literally unusable for all my use cases unless downgrading to 1.74.3 and disabling auto updates. All I do is remote dev containers.

I just upgraded to 1.75.0 and started seeing this on all of my dev containers configurations. In a local window the terminal works fine.

Related: https://github.com/microsoft/vscode-remote-release/issues/7999

Similar issue to @tjKairos , pty host process is becoming unresponsive when using v1.75.0, which is a part of the January 2023 release. Remote Pty Host under the Problems tab shows: [warning] Shell integration cannot be enabled for executable "/bin/sh" and args.

Upgraded to the latest release using Restart to Upgrade under the Help menu and could not use my terminal within VSCode: Version: 1.75.0 (user setup) Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164 Date: 2023-02-01T15:23:45.584Z Electron: 19.1.9 Chromium: 102.0.5005.194 Node.js: 16.14.2 V8: 10.2.154.23-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

Downgraded to November Release - v1.74.3 and able to use my terminal within VSCode again: Version: 1.74.3 (user setup) Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534 Date: 2023-01-09T16:59:02.252Z Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

** You might also need to disable auto-updates. I don’t remember setting the option for auto-updates but it requires manually disabling it after using v1.75.0. I went to settings, searched Update, change Update Mode to manual. To apply will require a restart which caused it to install the update for me again. I just ran the 1.74.3 installer again and good to go.

For users starting to face this issue on containers starting with 1.75 update, please follow https://github.com/microsoft/vscode-remote-release/issues/7964

The regression with 1.75 is from an update to our terminal dependency that switched to use posix_spawn over fork to create terminal agents. This issue tracks a bug that was before the update and unrelated.

@AnrDaemon this is already in insider’s and will be released to stable the first week of July

Same issue here. On three different Windows 10 systems I get the error message on 1.79.1 whenever I start the editor.

Downgrading to version 1.78.2 solves the problem.

This is unbelievably frustrating… After a clean install of latest Insiders the warning pops up without even starting the terminal in the first place! I have no extensions installed, nothing. It’s clean as possible. What is going on? Anyone else struggling with this?

I got this earlier all the time and then I deleted everything and now I get it when I try to download python extension back. Tried older versions of both python and vscode and vscode insiders but cant find a fix.

@xianghongai that issue should be fixed already.

Would like to add that I was having this problem with v 1.79.2 on Fedora Linux with Gnome desktop. I installed the insiders edition v1.80.0 and I no longer have this issue for what it’s worth.

I would get “The connection to the terminal’s pty host process is unresponsive” and after about 2 minutes, the terminal would finally show up. Comes up instantly in 1.80.0

I also have this problem,it 's so hard for me.I’dont kown why.extensive or use python programm?

Thanks, Megan. I’m travelling and don’t have time for playing with Insiders ATM. Will wait for next release and use separate tunnel for the time being.

@Tyriar Thank you for the work you’ve done here! Hopefully this fixes the long-standing issues we’ve been seeing.

Same issue here. On three different Windows 10 systems I get the error message on 1.79.1 whenever I start the editor.

Downgrading to version 1.78.2 solves the problem.

I solved it with your downgrade method, thank you!

Maybe we can add a parameter that allows tweaking the time-out period? Waiting a few seconds longer for the terminal to show up is not a big deal; the error message is more annoying.

@zsfc the thought also come up today that maybe it should be a status bar item when the terminal is focused, instead of a notification. Maybe only going to notification in the extreme case where it needs a restart or fails successive restarts. That way it would be a yellow status bar item that shows and goes away briefly, instead of an annoying notification.

Similar issue to @tjKairos , pty host process is becoming unresponsive when using v1.75.0, which is a part of the January 2023 release. Remote Pty Host under the Problems tab shows: [warning] Shell integration cannot be enabled for executable "/bin/sh" and args.

Upgraded to the latest release using Restart to Upgrade under the Help menu and could not use my terminal within VSCode: Version: 1.75.0 (user setup) Commit: e2816fe Date: 2023-02-01T15:23:45.584Z Electron: 19.1.9 Chromium: 102.0.5005.194 Node.js: 16.14.2 V8: 10.2.154.23-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

Downgraded to November Release - v1.74.3 and able to use my terminal within VSCode again: Version: 1.74.3 (user setup) Commit: 97dec17 Date: 2023-01-09T16:59:02.252Z Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

** You might also need to disable auto-updates. I don’t remember setting the option for auto-updates but it requires manually disabling it after using v1.75.0. I went to settings, searched Update, change Update Mode to manual. To apply will require a restart which caused it to install the update for me again. I just ran the 1.74.3 installer again and good to go.

Had this same problem after an update to 1.75 last night, rolled back to 1.74.3 as suggested and it all worked again. My system is a Fedora 34 VM.

I’m having a similar issue, but only on the most recent VSCode Insiders. It’s the same “pty host process is becoming unresponsive” message, but it doesn’t happen locally at all. It only happens when I’m using a remote dev container through the Remote-SSH and Dev Containers extensions. I turned off all the other extensions and it still happens immediately every time I try to start the dev container (even a default Alpine dev container with no additional configurations) and immediately after clicking the restart button. I’m connecting from Windows to a Linux server.

I installed the most recent stable VSCode version and it worked instantly without any fuss or other changes.

VSCode Insiders versions: Version: 1.75.0-insider (user setup) Commit: 0615c4f98b07b51d3be6a357e22afec119490c5a Date: 2023-01-31T00:03:50.170Z Electron: 19.1.9 Chromium: 102.0.5005.194 Node.js: 16.14.2 V8: 10.2.154.23-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: Yes

VSCode versions: Version: 1.74.3 (user setup) Commit: 97dec172d3256f8ca4bfb2143f3f76b503ca0534 Date: 2023-01-09T16:59:02.252Z Electron: 19.1.8 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: No

Thank you very much, @lorand-horvath, now, this was a pretty good piece of information!

I’ve downloaded the last VSCode release then, remove all Node instances from my system and the problem stopped! And, to solve de Node issue I’ve downloaded the .zip with the binaries and configure the Path for my local user only. This seams to have solved the problem for me, vscode is running good now! I’ll post if anything new appears!

Update: Upgrading my mac OS to Monterey solved the issue. I have no idea why.

While this is causing problems, is there a way to completely disable the integrated terminal or the pty host process?

Any thoughts whether this is possible @Tyriar @meganrogge ? If I have VS Code open I have to restart the ptyhost process about every 15 minutes or so even if I’ve never opened the integrated terminal so just trying to think about possible options 😅. Are there any logs I should share?

For MacOS folks that get referred here terminal.integrated.enablePersistentSessions: false fixed the issue for me.

Here are the timeouts related to the pty host heartbeat/responsiveness:

https://github.com/microsoft/vscode/blob/f6786c8f2ccf01a8aae2bbc0a3ef114b44a4a845/src/vs/platform/terminal/common/terminal.ts#L368-L390

You cannot customize them currently, if there’s no communication between the 2 processes in 10+ seconds then there is something very wrong, allowing configuration here wouldn’t be a great workaround.

@lorand-horvath you should update windows, Windows 7 was EOL in 2020 https://www.microsoft.com/en-us/windows/windows-7-end-of-life-support-information#:~:text=After 10 years%2C support for,ended on January 14%2C 2020. Also you never got to use conpty as it’s only in the later versions of Windows 10.