Quantcast
Channel: WSL2 - VSCode's shell command `code` no longer working in Linux terminal - Ask Ubuntu
Viewing all articles
Browse latest Browse all 8

WSL2 - VSCode's shell command `code` no longer working in Linux terminal

$
0
0

I am very new to Linux and WSL overall. I was able to use code . to open my current directory in VSCode, but after deleting something that I do not remember it just doesn't work anymore. I put in the command and it just hangs there.

I have deleted my Ubuntu-20.04 instance and recreated it, but still it will not work. Also checked my $PATH and it seems to be there.

Also, the add shell command in VSCode does not come up, so I can't uninstall and reinstall the shell shortcut.

Anyone have any idea?

drewbie@drewbie:/$ echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/dotnet/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/QuickTime/QTSystem/:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/Go/bin:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Users/Andrew/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/Andrew/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/Andrew/go/bin:/snap/bin

After inputing code . it just sits there

whereis and which

drewbie@drewbie:~$ whereis codecode: /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin/code /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin/code.cmddrewbie@drewbie:~$ which code/mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin/code

After doing what @NotTheDr01ds said in the thread below

drewbie@drewbie:~$ vi "$(which code)"drewbie@drewbie:~$ code .+ [  = true ]+ COMMIT=899d46d82c4c95423fb7e10e68eba52050e30ba3+ APP_NAME=code+ QUALITY=stable+ NAME=Code+ DATAFOLDER=.vscode+ realpath /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin/code+ dirname /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin/code+ dirname /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/bin+ VSCODE_PATH=/mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code+ ELECTRON=/mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/Code.exe+ IN_WSL=false+ [ -n Ubuntu-20.04 ]+ IN_WSL=true+ [ true = true ]+ export WSLENV=ELECTRON_RUN_AS_NODE/w:WT_SESSION::WT_PROFILE_ID+ wslpath -m /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js+ CLI=C:/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js+ WSL_EXT_ID=ms-vscode-remote.remote-wsl+ ELECTRON_RUN_AS_NODE=1 /mnt/c/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/Code.exe C:/Users/Andrew/AppData/Local/Programs/Microsoft VS Code/resources/app/out/cli.js --ms-enable-electron-run-as-node --locate-extension ms-vscode-remote.remote-wsl

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles



Latest Images