I want to quickly compile and execute C code, see the output, and then resume editing with just one shortcut key.
I installed the c/c++ compile run extension which compiles and executes the file and shows the output in the terminal. However, that leaves the terminal focused and I have to manually jump back to the editor.
I tried using a macro extension to string together two commands: one to compile and execute and one to jump back to the editor, but that didn't work. It just leaves me in the terminal.
UPDATE
OK, I modified the command macro to this in settings.json:
"macros": {
"execCMacro": [
"extension.CompileRun",
"workbench.action.focusFirstEditorGroup",
"workbench.action.focusFirstEditorGroup"
]
},
Note the duplicate command for putting the focus back to the first group. Probably has something to with it taking time for the terminal to get focus.
This probably isn't the best solution. Is there a command for inserting some short delay I might use? The macro uses the "macro-commandeer" extension.