These are the steps to add the ‘code’ command to your terminal to open a file or directory in Visual Studio Code.
- Open Visual Studio Code
- Use shift + command + p keys to open the command prompt
- Start typing “shell” and you should see an option in the drop down called “Shell Command: install ‘code’ command in PATH.“
- Select this option and confirm to install
Restart the terminal and the ‘code’ command should now be present.