How to Open Visual Studio Code Using Terminal
Last Updated :
19 Jun, 2025
Did you know you can launch Visual Studio Code directly from your terminal? It's quick, efficient, and makes coding workflows much smoother. In this guide, we'll show you how to set it up on both Windows and macOS.
How to Open VS Code From Terminal?
To open VS Code, you need to make sure VS Code is in your system's PATH. For that, open VS Code and configure a few VS Code settings.
Steps to Add VS Code to Your System PATH"
- Open VS Code.
- Press
Ctrl
+ Shift
+ P
or Cmd + Shift + P (on macOS) to open the Command Palette. - Type "Shell" and select "Shell Command: Install 'code' command in PATH." and hit Enter

Done! You can now launch VS Code directly from your terminal using the code command.
Note: If you don't have VS code, install VS code for your Windows, Mac or Ubuntu operating system.
Steps to Open Visual Studio Code From Terminal
Step 1: Open the Terminal
- Windows: Search for "Command Prompt" or "PowerShell"
- macOS: Press cmd + Space, type " Terminal", and hit Enter
- Ubuntu/Linux: Press Ctrl + Alt + T
Step 2: Use 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

And That's it, Now you know how to open Visual Studio Code directly from the terminal whether it's a current directory, a specific file, or a new project on windows, macOS, or Linux.
Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running, and version control. Starting VS code from the terminal allows developers to run commands quickly and efficiently, making coding faster and more convenient.
Hence, we have successfully accessed VS code using terminal in Windows or MacOS.
Also Read
Conclusion
Accessing Visual Studio Code (VS Code) from the terminal is a simple yet powerful skill for any developer. Whether you're working on Windows, macOS, or Linux, starting VS Code from the terminal can speed up your workflow and make project management easier. Just make sure the code command is installed, and you're good to go!
Similar Reads
How to Create a File in VSCode using Terminal? Sometimes, commands like touch or New-Item may not work as expected in VS Code due to environment limitations or missing shell extensions. However, using simple terminal commands, you can easily create and edit files of any type right from VS Code. , Let's learn how to create new files using the cod
2 min read
Custom C++ User Snippet in Visual Studio Code Snippets are the small portion of re-usable code wrapped in some prefix word, It allows programmers to bind a particular block of code in a single prefix keyword. Visual Studio Code is a Lightweight and powerful source code editor available in Windows, Linux, and macOS, It comes with many built-in s
3 min read
How to Run Powershell x86 Inside Visual Studio Code x64? If you need to run PowerShell x86 in Visual Studio Code, this guide will help you set up your PowerShell x86 configuration in VS Code. Despite Visual Studio Code being a 64-bit application, you can still execute PowerShell x86 in VS Code to ensure compatibility with 32-bit scripts or modules. We'll
4 min read
General Keyboard Shortcuts For Visual Studio Code Using Visual Studio Code keyboard shortcuts can significantly enhance your productivity and efficiency. Whether you're new to the platform or looking to improve your workflow, knowing the most common keyboard shortcuts in Visual Studio Code will help you navigate and edit code faster. This guide cov
3 min read
How to Set corresponding File Icon in Visual Studio Code? You can change the design of the folder icons using the Visual Icon Theme extension. Within VS Code, you can browse and install extensions. Click the Extensions icon in the Activity Bar on the side of VS Code or the View, as we demonstrated below. In this article, we are going to see, how to enable
1 min read
How Do I Disable VS Code of Updating Itself? Visual Studio Code is a powerful and popular code editor that frequently receives updates to improve functionality and security. However, these automatic updates might not always be convenient, especially if you prefer to control when your tools are updated. If you're looking to disable VS Code auto
5 min read