How to Open Visual Studio Code From Your Terminal

freeCodeCampfreeCodeCamp
2 min read

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:

Image

Next, run Command + Shift + P.

Now you should see this:

Image

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:

Image

Once you hit enter, voilà! You're all done. You should now see a success message:

Image

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:

Image

Once you hit enter, VS Code will now open.

And there you have it! Happy coding. :)

0
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.