I am using VS code 1.8.1 on Mac 10.12.3 (16D32). After launch vscode, I run cmd shift p
to open command search field. Then run Install code command in Path
. I can see the code got added on PATH but it got removed after I close vs code. Is there a way to add it permanently?
Launching from the command line# You can also run VS Code from the terminal by typing 'code' after adding it to the path: Launch VS Code. Open the Command Palette (Cmd+Shift+P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.
Use the View > Terminal menu command. From the Command Palette (Ctrl+Shift+P), use the View: Toggle Terminal command.
Windows and Linux installations should add the VS Code binaries location to your system path. If this isn't the case, you can manually add the location to the Path environment variable ( $PATH on Linux). For example, on Windows, VS Code is installed under AppData\Local\Programs\Microsoft VS Code\bin .
So I've just had this issue during setup of a new laptop and found a simple (but slightly embarrassing) solution that worked for me. After faffing about with it for way too long I noticed I had left it in Downloads. I moved the .app file to /Applications and ran the command-line install function again and now the "code" command persists.
Add this to your ~/.bash_profile
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
source: https://code.visualstudio.com/docs/setup/mac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With