To add code to PATH in macOS (in order to run code from the command line) we may to open up VS Code and open the 'Command Palette' with Shift+Command+P on Mac, or Shift+Control+P on Linux. In it, enter shell command and look for the Shell Command: Install 'code' command in PATH option. After doing this any new shell we open should be able to run code.
Created
June 8, 2018 18:20
-
-
Save jarek-przygodzki/671e9922c8906fbb78194355acd2f449 to your computer and use it in GitHub Desktop.
Add VS Code to PATH in macOS
Thank you @Nelwhix, that worked like a charm for me.
works for me when add PATH, thanks @Catalin-Ionut
i used this option because i don't have admin permissions.
Thanks @TheFriendlyCoder for this tip!!! <3
every time i restart my laptop i need to re-run this shell command, any solution
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another issue I found which can cause a very similar problem to happen is if you store your app package for VSCode in a temporary location / private folder (ie: in ~/Downloads for example) then the path to the application executable gets resolved to a transient temporary folder. The result of this is that after you shut down VSCode the symlink that is created in the /usr/local/bin folder breaks, because the transient folder gets removed post-shutdown.
To correct this particular issue, make sure to move your app package (ie: the "Visual Studio Code.app" file) to your applications folder (ie: /Applications) before launching the app.