It needs to be setup so that Code is found in your PATH
. If you’re on a mac system, do the following (for windows systems, read below):
- Launch VS Code
- Open up command palette (press F1) and type
shell command
to findShell Command: Install 'code' command in PATH command
. - Restart terminal
If you’re on Windows, you can also set the PATH manually by adding:
C:\Program Files (x86)\Microsoft VS Code\bin
to your PATH environment variable.
- Open command prompt
- Type the command –
setx path "%path%;C:\Program Files (x86)\Microsoft VS Code\bin"
- Restart terminal
Update: If you’re on Windows 10 and VSCode 1.47.2 and above, the new PATH has to be set to:
C:\Users\{username}\AppData\Local\Programs\Microsoft VS Code\bin