microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.73k stars 29.09k forks source link

Remote Tunnel VSCode Server install fails if WSL default shell is not Bash #232322

Open JeffMelton opened 4 hours ago

JeffMelton commented 4 hours ago

Does this issue occur when all extensions are disabled?: N/A

Steps to Reproduce:

  1. Set WSL2 default shell (Ubuntu 24.04.1 LTS) to something other than Bash. [I primarily use non-POSIX shells like Fish, Nushell, and Elvish.]
  2. Enable Remote Tunnel with Microsoft account on Windows 11 with WSL2.
  3. Sign in to Microsoft account on vscode.dev, connect to Remote Tunnel, see that you can open folders and edit files from the Windows filesystem as expected.
  4. Select Connect to WSL from the Command Palette, watch VSCode attempt to install/start the remote code server instance.
  5. Watch the crashloop begin: Image

The error in the attached screenshot is effectively fatal, reloading the window over and over.

  1. Close the tab.
  2. Change the default shell for WSL2 to Bash (or possibly some other POSIX-compliant shell).
  3. Reopen vscode.dev, connect to Remote Tunnel, Connect to WSL, watch the remote server installation succeed, then verify that you can open directories and edit files as expected.

I'm not sure what's going on behind the scenes with that code server install, but since launching code from WSL2 in any of the non-POSIX shells I use works just fine (i.e., delete ~/.vscode-server, launch code, watch the magic happen), it suggests an assumption that the default shell will be Bash (or at least something POSIX-compliant) for the installation and connection via Remote Tunnel.

JeffMelton commented 3 hours ago

I've worked around this by setting my default shell to Bash and changing the default WSL2 profile to launch my preferred shell, e.g., wsl -c '/usr/local/bin/elvish', but I haven't found any documentation yet that specifies a Bash or POSIX-compliant login shell.