When you click Run and nothing happens in VS Code, the button is usually not broken; it is asking a language extension, a task, or a terminal to execute a command that is missing, misconfigured, or pointed at the wrong folder. The Run control is a dispatcher, and every failure downstream of it surfaces as silence, a flash-and-close terminal, or a spin that never resolves. Understanding that chain, from menu item to debug adapter to shell to interpreter, turns a guessing game into a five-minute diagnosis.
The core mechanism is delegation. VS Code is an editor first. Its Run menu does not compile or interpret your code itself. It reads what you have open, checks which extensions claim that file type, and hands the job to a debug adapter or task provider. If no provider claims the file, the button can appear to do nothing at all. That is the single most common explanation, and it hides behind a dozen different visible symptoms.
What the Run button actually invokes
Pressing F5 or clicking Run Without Debugging starts a lookup. VS Code asks the Debug Adapter Protocol layer which adapter is registered for the active file's language. Extensions such as the Python, C/C++, Java, and Go extensions register these adapters and launch configurations. If exactly one adapter exists, VS Code may launch it directly. If several exist, it opens a picker. If none exists, the command resolves to nothing.
The launch path has two branches. Debug (F5) attaches a debugger, sets breakpoints, and routes program output to the Debug Console by default. Run Without Debugging (Ctrl+F5) skips the debugger and usually sends output to an integrated terminal. This distinction matters because a program that runs fine under Ctrl+F5 but "does nothing" under F5 is often producing output in a console the user is not watching.
Behind the adapter sits the integrated terminal. VS Code spawns a shell, injects the command, and captures exit codes. When the shell path is invalid, the terminal fails to initialize, and the run silently aborts. On Windows this frequently traces to a misconfigured terminal.integrated.defaultProfile.windows setting or a missing PowerShell profile. The editor shows a brief terminal flash and returns to idle.
One level deeper: the debug adapter and the terminal are separate processes. A crash in the adapter process does not always surface as an error dialog. It can log to the Debug Console or to the Output panel under the extension's channel. Checking those two panels is the fastest way to convert silence into a specific error string. A plain-language version: the button talks to a middleman, and the middleman's diary is in the Output panel.
Quantified context: how often each layer fails
Failure rates are not published for VS Code runs, so the honest framing is structural rather than statistical. What can be quantified is the configuration surface. A default VS Code install ships with zero language-specific run support; every executable language needs at least one extension. The Python extension alone exposes dozens of interpreter and environment settings, and C/C++ adds compiler path, include path, and task definitions.
The practical multiplier is environment drift. A machine can hold multiple Python installs (system, pyenv, conda, Microsoft Store), several Node versions via nvm, and two or three C compilers. VS Code's interpreter picker stores a selection per workspace, and that stored path can go stale after an upgrade. When the path breaks, the Run button resolves to a command that cannot start, and the symptom is silence rather than a clear "interpreter not found" message.
Terminal startup adds another layer. A shell profile that takes several seconds to load, or one that prints to stdout, can interleave with the injected run command and garble it. Users report the command appearing but not executing, or the terminal closing immediately. Immediate closure usually means the process exited with a nonzero code and the terminal profile is set to close on exit. The run did happen; the evidence vanished.
The launch chain, layer by layer
| Layer | What it does | Typical silent failure | Where the error appears |
|---|---|---|---|
| Run command | Resolves menu action to a provider | No provider for file type | Nowhere; picker never opens |
| Debug adapter | Registers language and config | Adapter crashed or outdated | Output panel, extension channel |
| Launch config | Supplies program path and args | Wrong program or cwd | Debug Console, red squiggle |
| Integrated terminal | Spawns shell and injects command | Bad shell path or profile | Terminal flash, then idle |
| Interpreter/compiler | Executes the actual code | Missing binary or PATH mismatch | Terminal stderr, exit code |
| Program output | Writes results to a console | Wrong console selected | Debug Console vs terminal split |
Read the table top to bottom. Each row can fail independently, and each has a different evidence trail. The professional habit is to identify which row failed before changing any setting. Changing settings at random moves the failure without fixing it.
Edge cases that mimic a dead Run button
A file that is not saved can run stale code or fail to resolve imports, because many adapters launch the on-disk file, not the buffer. An unsaved file with a syntax error may still show the old output, which reads as "Run does nothing."
Multi-root workspaces confuse launch resolution. The program path in launch.json may be relative to a folder that is not the one holding the active file. VS Code resolves it against the workspace folder, and with several roots the wrong one can win. Setting ${file} or ${workspaceFolder} explicitly removes the ambiguity.
Remote and container sessions add a boundary. When you are attached to a dev container, WSL, or SSH host, the Run button executes on the remote side. An interpreter installed locally is invisible there. This is a frequent source of "it works on my laptop" reports: the extension is installed locally but not in the remote, or the remote lacks the runtime.
Jupyter and interactive-window modes blur the line. Python's interactive window can capture a run and route output to a notebook cell rather than the terminal. If that pane is closed or hidden behind another editor group, the run looks inert. The same applies to output routed to the Debug Console when the user expects a terminal.
Extensions can also conflict. Two extensions claiming the same language, or a workspace-recommended extension that failed to install, can leave the provider list in an inconsistent state. The Extensions view shows installation state, but a partially installed or disabled extension still appears in the list.
Red flags that indicate something deeper than a missing setting: The Run button stays greyed out even for a saved file with a recognized extension. Every terminal you open closes within a second of launching. The Output panel shows adapter errors on startup, before any run. The same project runs on one machine and fails identically on another with the same extension versions. A workspace trust prompt was dismissed, leaving the workspace in Restricted Mode.
Restricted Mode deserves its own note. VS Code disables extension-provided run and debug features in untrusted workspaces as a security measure. The button may respond but refuse to execute, and the trust banner may have scrolled out of view. Granting trust in the Workspace Trust editor restores the provider. This is the counterintuitive detail many thin guides miss: the most common "nothing happens" cause on a shared or newly cloned repository is a security gate, not a broken install.
Misconceptions that waste debugging time
The first misconception is that the Run button runs code. It dispatches to a provider; the provider runs code. Reinstalling VS Code rarely helps because the editor is not the executor.
The second is that a missing launch.json is always the problem. For many languages, the extension can generate a configuration on demand or run without one. A missing config triggers a prompt, and dismissing that prompt leaves the run unresolved. The fix is to answer the prompt, not to hand-write JSON.
The third is that terminal silence means the code did not execute. Output can be routed to the Debug Console, the Output panel, or a hidden interactive window. Checking all three consoles before touching settings prevents unnecessary changes.
A fourth misconception conflates syntax errors with run failures. A file with a compile error does execute the run pipeline; it fails at the compile step and prints diagnostics. That is not the same silent failure as a missing provider. Reading stderr tells you which you have.
The professional caveat: extension version skew is a real and underdiagnosed cause. An adapter built for an older runtime may fail to handshake with a newer interpreter and exit without a visible message. Keeping the language extension and the runtime within supported ranges, and checking the extension's compatibility notes after a runtime upgrade, resolves a class of failures that settings changes cannot.
Practical actions in order
Work top to bottom and stop at the first step that reveals an error. This sequence avoids changing settings that were already correct.
Open the Output panel and select the language extension's channel. Read the last lines before the run attempt. This surfaces adapter crashes and handshake errors. Open the Debug Console. Run once with F5 and read any red text. This catches launch-config errors such as a wrong program path. Confirm the active language has an enabled, installed extension. Check the Extensions view for disabled or incompatible states. Run the interpreter or compiler directly in the integrated terminal. If the bare command fails there, the problem is the environment, not VS Code. Select the correct interpreter or toolchain explicitly via the Command Palette picker, then retry. Clear stale workspace selections. If a launch config exists, replace hardcoded paths with ${file} or ${workspaceFolder} tokens and confirm the cwd points at the intended root. Check Workspace Trust. If the workspace is in Restricted Mode, grant trust and retry. For remote sessions, install the extension and runtime on the remote host, not just locally.
Thresholds for deciding when to escalate: if steps 1 through 3 produce no error text and the bare command in step 4 succeeds, the issue is almost always the launch configuration or the active workspace folder. If step 4 fails, treat it as an environment or PATH problem and fix it outside VS Code first. If a settings change appears to fix the run but the error returns after a restart, the value was set at the wrong scope (user, workspace, or folder) and needs to be set at the scope that matches where you work.
One unit note for consistency: this guidance assumes a single-machine setup in the US default locale. Remote and container setups follow the same order but apply each step on the remote side.
Limits of this diagnosis and what it cannot settle
Some failures have no local fix. A corporate policy that blocks execution, an antivirus quarantine on the interpreter binary, or a filesystem permission error on the workspace folder will defeat every setting change. Those require administrator action.
This guide also cannot tell you which specific error string you will see, because adapters and extensions evolve. The mechanism is stable; the message text is not. When in doubt, trust the Output and Debug Console channels over any menu behavior, since the panels report what actually happened while the button only reports intent.
Finally, the boundary between an editor problem and a project problem is real. If the code runs from a plain terminal outside VS Code, the editor configuration is at fault. If it fails in both places, the project or environment is at fault. Establishing that boundary first saves the most time, and it requires no settings knowledge at all.