0

I'm attempting to add Visual Studio Code to my command line so I can open a project by typing 'code .'

I've followed the instructions on this page: https://code.visualstudio.com/docs/setup/mac and it works but does not remain permanent. Every time I restart my terminal the command line tools are gone and tells me command not found.

How can I add this permanently? My previous editor was Atom and I can't remember how I set that up to open from the command line.

Any help would be greatly appreciated.

1

1 Answer 1

0

What worked for me was to add:

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}

to my .bash_profile file. Now whenever I type 'code' on the command line VScode opens.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks ! That seemed to do the trick! I'm using zsh not bash so I had to add that to my .zshrc file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.