I have Windows 10 + WSL2 with the latest version of VSCode. I also have a simple .code-workspace file which I can double-click (from within the windows file-explorer) and launch VSCode in a way that it pops-up already attached to a specific docker-container that is up-and-running.
This works great with double-clicking on the .code-workspace file:
{
"folders": [
{
"uri": "vscode-remote://attached-container+7b2...27d/workspace/foobar"
}
],
"remoteAuthority": "attached-container+7b2...27d",
"settings": {}
}
Apart from double-clicking I can also invoke VSCode from Windows command-line (dos) and this works ok too:
"C:\Program Files\Microsoft VS Code\Code.exe" "C:\path\to\foobar.code-workspace"
However when I try to open the workspace from within WSL2:
code ./foobar.code-workspace
Even though VSCode pops-up the workspace doesn't open properly. What should I do to make the WSL2 (bash) command-line work the same way as in Windows?