How to Open Visual Studio Code From Your Terminal
By Madison Kanna
In this tutorial, we'll go over how you can open the VS Code text editor (Visual Studio Code) from your Mac terminal.
Opening your text editor from your terminal is a quick, easy way to open up new projects and begin coding faster.
How to Download and Open VS Code
The first thing you'll need to do is open up VS Code. If you don't have VS Code yet, you can download it here. VS Code is a popular text editor created by Microsoft.
Once you have VS Code open, it should look like this:
Next, run Command + Shift + P
.
Now you should see this:
What we've done here is opened up the VS Code command palette. This will allow you to customize your VS Code settings, among other things.
Next, into the command palette type shell
and hit enter
. When you type shell
, your editor should look like this:
Once you hit enter, voilà! You're all done. You should now see a success message:
Now you can open VS Code from your terminal. Let's do this now.
How to Open VS Code from the Terminal
First, open up your terminal. You can open your terminal in a few ways. One way of opening your terminal is hitting the command
button and the spacebar
at the same time. This opens spotlight search. From here, you can type "terminal".
Once your terminal is open, you can open VS Code from it by typing $ code .
Then hit enter
.
Here's how this should look:
Once you hit enter
, VS Code will now open.
And there you have it! Happy coding. :)
Subscribe to my newsletter
Read articles from freeCodeCamp directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
freeCodeCamp
freeCodeCamp
Learn to code. Build projects. Earn certifications—All for free.