🌐
Visual Studio Code
code.visualstudio.com › docs › terminal › getting-started
Getting started with the terminal
November 3, 2021 - Learn how to get started running shell commands with the integrated terminal in Visual Studio Code.
🌐
Alphr
alphr.com › home › how to run code in terminal in vs code
How to Run Code in Terminal in VS Code
October 16, 2023 - While here, choose “New Terminal.” · Go to the directory containing the code file through the “cd” command. If a file is within “Document” for example, the command used here should be “cd Documents.” This allows you to navigate to the folder. When the right directory is found, you should run the code file. Do so by typing the right command for the specific programming language being used.
Discussions

How do I run code through the terminal in VSCode?
On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge. If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options: Limiting your involvement with Reddit, or Temporarily refraining from using Reddit Cancelling your subscription of Reddit Premium as a way to voice your protest. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/learnprogramming
9
1
November 21, 2023
how to run program in c in visual studio code
Hi, I am using visual studio code version 1.107.1 (user setup). for learning programing in "C" . I need help to setup studio code, to create workspace, file and run the debug . I have setup c/c++ , c/c++run extension. I have download gcc… More on learn.microsoft.com
🌐 learn.microsoft.com
1
1
December 21, 2025
cmd - How to run VS Code program on command prompt? - Stack Overflow
In VS Code however, the program is run in the integrated debug console. Is there a way I can set VS Code to open up cmd prompt and run my program there, rather than the VS Code debug console? ... Your question is not about an issue with your provided code, it is about configuring a specific piece of software, and is therefore not an appropriate question for StackOverflow. ... Go to settings and search "Terminal... More on stackoverflow.com
🌐 stackoverflow.com
How to call VS Code Editor from terminal / command line - Stack Overflow
The question says it all. How can I open VS Code editor from windows cmd linux and mac terminal e.g. for notepad++ I write > start notepad++ test.txt By the way, the editor is awesome (cross- More on stackoverflow.com
🌐 stackoverflow.com
People also ask

What do I do if am having issues launching the VS terminal?

If you are having issues launching the terminal, go to the troubleshooting guide where you can get further guidance.

🌐
alphr.com
alphr.com › home › how to run code in terminal in vs code
How to Run Code in Terminal in VS Code
Is it possible to create an admin terminal?

Normally, an integrated shell runs with VS Code permissions. If the aim is to run the shell with administrator or any other permission, utilize “runas.exe” and such other utilities in the terminal.

🌐
alphr.com
alphr.com › home › how to run code in terminal in vs code
How to Run Code in Terminal in VS Code
🌐
Visual Studio Code
code.visualstudio.com › docs › terminal › basics
Terminal Basics
November 3, 2021 - This is mostly a macOS problem and does not happen in external terminals. The typical reasons for this are the following: npm was globally installed using another instance of node that is somewhere in your path (such as /usr/local/bin/npm). To get the development tools on the $PATH, VS Code will launch a bash login shell on startup. This means that your ~/.bash_profile has already run and when an integrated terminal launches, it will run another login shell, reordering the $PATH potentially in unexpected ways.
🌐
Reddit
reddit.com › r/learnprogramming › how do i run code through the terminal in vscode?
r/learnprogramming on Reddit: How do I run code through the terminal in VSCode?
November 21, 2023 -

I’m trying to follow along to the CS50 YouTube video, and I’m stuck on one part (Week 1 - C) that requires VSCode. I downloaded it and put the code in, but the dollar sign as shown in the video was not in my terminal. And when I tried running the code, I kept getting the error message “The term is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.” I looked through settings and YouTube videos but they didn’t help or were too confusing. How do I fix this?

🌐
Medium
medium.com › @yutung3397 › getting-started-how-do-i-run-a-program-in-visual-studio-code-15c6193c34b5
Getting Started — How do I run a program in Visual Studio Code? | by Michelle Cu | Medium
July 8, 2025 - By pressing shift+command+r, the file will run automatically. The easiest way, which I found only after an hour of debugging, is to install an extension. Install the “code runner”, and a “run code” button would then appear when you click ...
🌐
YouTube
youtube.com › bytepage
How to run code in terminal in VS code | Visual studio Code - YouTube
In this video, we'll be exploring the topic of terminal execution in VS Code. We'll be looking at how to run code in the terminal, and how to use different t...
Published   July 28, 2023
Views   333K
Find elsewhere
🌐
Visual Studio Code
code.visualstudio.com › docs › introvideos › codeediting
Code editing in Visual Studio Code
November 3, 2021 - Create New Terminal (⌃⇧` (Windows, Linux Ctrl+Shift+`)) Run the application. ... Productivity Tips -Become a VS Code power user with these productivity tips. Introductory Videos - Review the entire list of videos.
🌐
YouTube
youtube.com › watch
How to Run Code in Terminal in Visual studio Code - YouTube
How to Run Code in Terminal in Visual studio Code🔧 Learn How to Run Code in the Terminal in Visual Studio Code! 🚀In this step-by-step tutorial, you’ll lear...
Published   April 4, 2025
🌐
Visual Studio Code
code.visualstudio.com › docs › setup › mac
Installing Visual Studio Code on macOS
May 13, 2026 - The Download Visual Studio Code page also lists Universal, Intel chip, and Apple silicon builds. To run VS Code from the terminal by typing code, add VS Code to the $PATH environment variable.
🌐
YouTube
m.youtube.com › watch
How to Run Code in Terminal in VSCode (2024) - Visual ...
Share your videos with friends, family, and the world
Published   January 18, 2024
🌐
Visual Studio Code
code.visualstudio.com › docs › getstarted › getting-started
Tutorial: Agentic coding in VS Code
May 13, 2026 - You don't need to open the folder in VS Code yet. In the next step, you open it in the Agents window, which lets you work across multiple workspaces without opening a separate window for each one. On your computer, create a new folder named myportfolio. Put the folder under Git version control to track changes. Open a terminal and run the following commands:
🌐
VSCode.one
vscode.one › start-vscode-from-terminal
How to start VS Code from the terminal (command line)
On windows, open a Command Prompt window, on MacOS, open a terminal window. In this case I want to navigate to my desktop to open a folder called "MyProject" ... Here is a quick clip demonstrating the process on windows: The process is the same on MacOS. The "code" command means you no longer have to manually right click the folder or file you want to open and click "Open with Code."
🌐
Alphr
alphr.com › home › how to run code in vs code
How to Run C Code in VS Code
May 13, 2023 - Run the code with Ctrl + Alt + N or any of the other methods mentioned above. Once you complete the one-time software setup, you’ll be able to use VS Code and the C language easily.
Top answer
1 of 1
1

To run a C program in Visual Studio Code, follow these steps:

  1. Install the C/C++ Extension: Ensure you have the C/C++ extension installed in Visual Studio Code. You mentioned you have this set up, which is great.
  2. Set Up a Workspace: Create a new folder for your C projects. Open Visual Studio Code and select File > Open Folder... to open your newly created folder.
  3. Create a C File: Inside your workspace folder, create a new file with a .c extension (e.g., hello.c). You can do this by right-clicking in the Explorer pane and selecting New File.
  4. Write Your Code: Write your C code in the newly created file. For example:
       #include 
       
       int main() {
           printf("Hello, World!\n");
           return 0;
       }
    
  5. Configure Build Tasks: You need to set up a build task to compile your C code. Press Ctrl + Shift + B to open the build tasks menu. If prompted, select Create tasks.json file from template and choose Others. Modify the generated tasks.json file to include the following:
       {
           "version": "2.0.0",
           "tasks": [
               {
                   "label": "build",
                   "type": "shell",
                   "command": "gcc",
                   "args": [
                       "-g",
                       "${file}",
                       "-o",
                       "${fileDirname}/${fileBasenameNoExtension}"
                   ],
                   "group": {
                       "kind": "build",
                       "isDefault": true
                   },
                   "problemMatcher": [
                       "$gcc"
                   ],
                   "detail": "Generated task by gcc"
               }
           ]
       }
    
  6. Build Your Program: Press Ctrl + Shift + B again to build your program. This will compile your C code and create an executable in the same directory.
  7. Run Your Program: Open the terminal in Visual Studio Code (View > Terminal or `Ctrl + ``) and run your program by typing:
       ./hello
    
    (Replace hello with the name of your executable if different.)
  8. Debugging: To debug your program, you will need to set up a launch configuration. Go to the Run view (left sidebar) and click on create a launch.json file. Choose C/C++: g++ build and debug active file. This will create a launch.json file where you can configure debugging settings.
  9. Start Debugging: Set breakpoints in your code by clicking in the gutter next to the line numbers. Then, press F5 to start debugging your program.

By following these steps, you should be able to set up Visual Studio Code for C programming and run your code successfully.


References:

  • Walkthrough: Compile a C program on the command line
🌐
Visual Studio Code
code.visualstudio.com › docs › configure › command-line
Command Line Interface (CLI)
November 3, 2021 - To do this, from an open terminal or command prompt, navigate to your project folder and type code .: ... Users on macOS must first run a command (Shell Command: Install 'code' command in PATH) to add VS Code executable to the PATH environment ...
🌐
Stack Overflow
stackoverflow.com › questions › 65883973 › how-to-run-vs-code-program-on-command-prompt
cmd - How to run VS Code program on command prompt? - Stack Overflow
... Your question is not about an issue with your provided code, it is about configuring a specific piece of software, and is therefore not an appropriate question for StackOverflow. ... Go to settings and search "Terminal: Explorer Kind".
🌐
freeCodeCamp
freecodecamp.org › news › how-to-write-and-run-c-cpp-code-on-visual-studio-code
How to Write And Run C and C++ Code in Visual Studio Code
January 20, 2023 - Scroll down a little bit until you find Code-runner: Run In Terminal. Make sure that the box is checked (✔). ... Now you need to restart your VS Code/VS Code Insiders. Simply close and reopen the program.
🌐
Quora
quora.com › How-do-I-run-a-Visual-Studio-code-from-terminal
How to run a Visual Studio code from terminal - Quora
Answer: By terminal, do you mean 1) Command Line on Windows? 2) Terminal on Mac 3) Terminal on Linux 4) As a default GIT editor on Windows 5) As a default GIT editor on Mac 6) As a default GIT editor on Linux For #1 Running Visual Studio Code on Windows Install visual studio code and select the ...
Top answer
1 of 16
399

To open a file or directory use the command:

code /path/to/file/or/directory/you/want/to/open

For macOS users, it needs to be installed manually:

  1. Launch VS Code.
  2. Command + Shift + P to open the Command Palette.
  3. Type shell command, to find the Shell Command: Install 'code' command in PATH and select to install it.
  4. Restart your terminal.
2 of 16
87

Per the docs:

Mac OS X

  1. Download Visual Studio Code for Mac OS X.
  2. Double-click on VSCode-osx.zip to expand the contents.
  3. Drag Visual Studio Code.app to the Applications folder, making it available in the Launchpad.
  4. Add VS Code to your Dock by right-clicking on the icon and choosing Options, Keep in Dock.

Tip: If you want to run VS Code from the terminal, append the following to your ~/.bash_profile file (~/.zshrc in case you use zsh).

code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}

Now, you can simply type code . in any folder to start editing files in that folder.

Tip: You can also add it to VS Code Insiders build by changing "com.microsoft.VSCodeInsiders". Also if you don't to type the whole word code, just change it to c.

Linux

  1. Download Visual Studio Code for Linux.
  2. Make a new folder and extract VSCode-linux-x64.zip inside that folder.
  3. Double click on Code to run Visual Studio Code.

Tip: If you want to run VS Code from the terminal, create the following link substituting /path/to/vscode/Code with the absolute path to the Code executable

sudo ln -s /path/to/vscode/Code /usr/local/bin/code

Now, you can simply type code . in any folder to start editing files in that folder.

🌐
GeeksforGeeks
geeksforgeeks.org › techtips › how-to-open-vs-code-using-terminal
How to Open Visual Studio Code Using Terminal - GeeksforGeeks
December 5, 2025 - Done! You can now launch VS Code from any terminal using the code command. Note: Install VS Code first if you haven’t already (Windows, Mac or Ubuntu)