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.69k stars 299 forks source link

wsl2 "code: command not found" #4033

Closed Spongman closed 4 years ago

Spongman commented 4 years ago

Version: 1.51.1 (system setup) Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f Date: 2020-11-10T23:34:32.027Z Electron: 9.3.3 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Windows_NT x64 10.0.19041

Steps to Reproduce:

  1. install wsl2
  2. connect to wsl2 in vscode
  3. open terminal
  4. code file.txt
$ code file.txt
-bash: code: command not found

$ find ~/.vscode-server -name code
/home/user/.vscode-server/bin/e5a624b788d92b8d34d1392e4c4d9789406efe8f/bin/code

works fine in wsl1. works fine over ssh.

Spongman commented 4 years ago

this was due to interaction with 00-wsl2-systemd.sh script.