'Run code' is not working in Visual Studio Code

Jeffrey picture Jeffrey · Jun 8, 2018 · Viewed 9.8k times · Source

When I click 'Run code' on the top right corner, or right click then click 'Run code', or use Ctrl+Alt+N, the integrated terminal does not appear and code could not run.

However, I can open the integrated terminal in vscode under View, and able to run code there using commands.

I believe my setting is correct as following. The problem happens suddenly, regardless of language.

"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe",
"code-runner.runInTerminal": true,

So How do I solve this to enable running code directly?

Answer

Watusimoto picture Watusimoto · Jun 19, 2019

I had the same problem, and solved it by adding:

"folders": [
    {   
        "path": "."
    },
],

to my code-workspace file