I have the Creators update installed. WSL is operational. I can execute most .exe files by simply calling notepad.exe
But when it comes to VS Code.... I can't use the default code
command or call code.exe
... I have also tried code
and code.cmd
. Why doesn't VS Code execute like other programs? And is there a way to enable the code
command?
EDIT: I now get these errors:
me@mypc:/mnt/c/Users/me/Documents/project_folder$ code . /mnt/c/Program Files (x86)/Microsoft VS Code/bin/code: line 7: realpath: comma nd not found /mnt/c/Program Files (x86)/Microsoft VS Code/bin/code: line 14: ./Code.exe: No such file or directory
Alternatively, you can open a Remote WSL window directly from VS Code: Start VS Code. Press F1, select Remote-WSL: New Window for the default distro or Remote-WSL: New Window using Distro for a specific distro. Use the File menu to open your folder.
sudo code . It is recommended to start vscode as a normal user. To run as root, you must specify an alternate user data directory with the --user-data-dir argument.
One way of opening your terminal is hitting the command button and the spacebar at the same time. This opens spotlight search. From here, you can type "terminal". Once your terminal is open, you can open VS Code from it by typing $ code .
The Creators update did install the interop functionality. However, it seems you need to install realpath
in WSL in order for the path to be recognized. I'm not sure why this is the case but running sudo apt-get install realpath
fixed it for me!
EDIT: After updating to the Fall Creators Update launching VSCode from WSL works out of the box 🎉
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With