How to Start Visual Studio Code from the Terminal

You can quickly launch Visual Studio Code using your computer’s terminal. The following guide shows the steps to run VS Code from the terminal. This guide applies to Windows, Mac, and Linux users.

Launch VS Code from the terminal

Follow these steps:

  1. First, open your preferred terminal on your computer. For example, we are using Command Prompt on Windows.
  2. Enter the following code in the terminal:
    code -n
  3. Then, hit Enter.
    New Window
    Type code -n in the terminal and press Enter.

    VS Code will now automatically launch.

Launch a VS Code file, folder, or project directly from the terminal

First, navigate to the folder’s directory. You can use the cd command to navigate to the directory. For example, if you want to open a folder named “Practice” stored on the Desktop. Run the following codes:

cd Desktop

Press Enter.

cd Practice

Press Enter.

code .

Press Enter.

Project
Navigate to the folder and run the code . command.

Your project folder will be opened in the VS Code.

Leave a Comment