I installed Code Runner
to compile my C code.
I want the .exe
will be directly opened on my cmd after compiling the program like the way Visual Studio is working.
How can I do that?
as it mentions in the marketplace
Go to VS Code > Preferences:
You will see Code-Runner: Executor-Map
click on Edit in settings.json, You'll see something like this:
{
"window.zoomLevel": 0,
"C_Cpp.updateChannel": "Insiders",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.iconTheme": "material-icon-theme",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.configuration.checkProjectSettingsExclusions": false,
"explorer.confirmDelete": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDragAndDrop": false
}
Then add this below "explorer.confirmDragAndDrop": false
, like this:
{
"window.zoomLevel": 0,
"C_Cpp.updateChannel": "Insiders",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.iconTheme": "material-icon-theme",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.configuration.checkProjectSettingsExclusions": false,
"explorer.confirmDelete": false,
"javascript.updateImportsOnFileMove.enabled": "always",
"explorer.confirmDragAndDrop": false,
"code-runner.executorMap": {
"javascript": "nodejs",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && start $dir$fileName"
}
}
And Congratulations :)