I'm using VS Code with WSL. To edit code in WSL, I need to navigate to the directory in WSL and then type code .
to open VS Code in the same directory. It was working before, but all of a sudden I can't get this command to work. I get the error zsh: command not found: code
.
Things I have tried:
- Both Dan Lowe's and starryknight's answers to this similar question. When I tried Dan Lowe's answer, I couldn't actually find the option "Shell Command: Install 'code' command in PATH". There was no change from trying starryknight's answer of adding the VS Code bin to PATH in .zshrc (zsh is the boot shell).
- Restarting WSL (Ubuntu 20.04).
- Closing the VS Code app.