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
 
 


As an Amazon Associate I earn from qualifying purchases.

My favorite quotations..


“A man should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”  by Robert A. Heinlein

"We are but habits and memories we chose to carry along." ~ Uki D. Lucas


Popular Recent Articles