Issue
My computer crashed and I had to reinstall my system today. I'm running Windows 10 with VS Code and I'm using Debian (WSL) as my main terminal.
I have installed VS Code with the "Add to PATH" option and I have activated the Windows Subsystem for Linux in PowerShell.
I can use the command "code" in CMD and PowerShell but when I try to run it in Debian I get
"-bash: code: command not found"
, as far as I understand it should work straight away when installing with the "path" option? At least according to this article: https://dev.to/ajeet/the-ultimate-guide-to-use-vs-code-with-windows-subsystem-for-linux-wsl-51hc
I have also tried installing the "Remote Development" extension, but I'm still facing the same problem.
Solution
Try adding the following line to the .bashrc
file in your $HOME
directory (~/.bashrc
).
PATH=$PATH:/mnt/c/Users/$USER/AppData/Local/Programs/Microsoft\ VS\ Code/bin
Where you replace $USER
with your Windows username.
Answered By - octavemirbeau Answer Checked By - Pedro (WPSolving Volunteer)