How to add VS code executable to the command line on macOS?

 







% nano .zprofile

#### VS code - Uki 2022-06-26 ####
## set PATH to "code" executable so it is available directly from Terminal
export PATH="\$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin"
## the following line is the key to launch "code" from the command line
alias code='/Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron'




After adding these lines, save it in NANO by pressing 

control x 

Do not forget to double-check your work.

% cat .zprofile 

And re-run the content of the .zprofile: 

% . ~/.zprofile
 
 

No comments:

Post a Comment