microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.64k stars 285 forks source link

Remote-SSH: Keep being asked for platform #10211

Open chrmarti opened 1 month ago

chrmarti commented 1 month ago

Using the steps from https://github.com/microsoft/vscode/issues/226759 (with the custom port) I'm asked for the remote platform every time I connect.

Remote-SSH v0.114.2024083019 on Windows.

There is an entry for localhost in the user settings:

  "remote.SSH.remotePlatform": {
    "win11-server2": "windows",
    "localhost": "linux"
  },
alexandruavadanii commented 1 week ago

I am on vscode Insiders (on Windows), connecting strictly to a small number of Linux hosts. I noticed a while ago that remote.SSH.serverInstallPath started being ignored and the remote server was installed in $HOME, but didn't pay too much attention. Recently, remote.SSH.remotePlatform started being ignored too, so I'm also asked about the remote platform every time.

It looks like this only affected the current profile, switching to the default profile (which I normally never use) works around the issue.

So, I used the new vscode profile editor -> my broken profile -> contents -> settings -> open JSON -> sure enough, both remote.SSH.remotePlatform and remote.SSH.serverInstallPath used very old values that did not reflect any recent changes I made.

I think there is some confusion (either in the extension or in the vscode profile handling) when it comes to which profile JSON is updated when the settings are edited using the settings editor or used when the connection is initialized.

Another interesting behavior related to this that I observed:

I know this is not very well documented and your mileage might vary trying to reproduce this, but if someone else runs into this problem, at least there's a workaround editing the broken profile JSON...

Edit: This might be a vscode profile issue: