Open In App

How to Open VS Code Using Terminal?

Improve
Improve
Like Article
Like
Save
Share
Report

Getting all your projects using a terminal is a new fun! Yes, you heard it right, you can access VS Code projects using the terminal which is nothing but short and easy-to-remember commands. Starting VS code from the terminal provides a convenient and efficient way, especially for developers who are comfortable with the command line.

In this article, we’ll learn how to open VS Code using the terminal on both Windows and macOS. The process is the same for both operating systems. Now dwelling further, we need to follow sequential steps to start VS Code from the terminal, which is as follows:

Pre-requisite: Ensure VS Code is in Your System’s Path

You need to make sure that the VS Code is in your system’s PATH. For that open VS code and configure a few VS code settings.

  • Open VS Code.
  • Press Ctrl + Shift + P to open the command palette.
  • Type “Shell” and select “Shell Command: Install ‘code’ command in PATH.” and hit Enter

How-to-Open-VS-Code-Using-Terminal

Now you can access VS Code using terminal.

Note: If you don’t have VS code, install VS code for your Windows, Mac or Ubuntu operating system.

How to Open VS Code Using Terminal?

  • Open the terminal in Windows ( Ctrl + Alt + T ) or Mac ( command + T ).
  • Type the following commands to open VS code.

Command 1: To open VS code in the current directory.

Code

Command 2: To open a specific file or folder in VS code.

code [path to file]

Command 3: To start a new project in VS code

 code -n

Check out: How to Create a File in VSCode using Terminal?

For more such commands, get help using the following command. It displays VS Code command-line options and descriptions.

code --help

code---help-command

That’s it, now you can open the file or folder in your favorite code editor – VS Code from the terminal on both Windows and macOS

Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running, and version control. Starting VS code from terminal allows us to send simple text commands to our computer to do things way more fast and easy.

Hence, we have successfully accessed VS code using terminal in Windows or MacOS.

Also Read


Last Updated : 30 Jan, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads