VSCode extension to run executables directly from the Explorer.
This extension provides different ways of running files:
- Run in Terminal: Creates a new Terminal, and runs the file.
- Open External: Opens the file with the preffered external program. If the file is executable, will launch it.
You can run files like this in two different ways:
- From the File Explorer
- In the opened files toolbar
There is one setting that allows you to change the command that is executed for specific file types, or specific files.
These can be changed in run - command mapping
id run.FiletypeMappings
For file types, this is useful if you need them to be executed with something in particular, i.e.:
'.sh': 'sh $0'
For specific files, this can also be useful for setting arguments:
'bat.bat': 'start $0 -arg'
The value $0
will be replaced by the file path.
You can access the new options from the explorer right-click menu:
Or from the toolbar of opened files:
After selecting the Run in Terminal
option, a new terminal will be opened, and your program will start:
The Open External
option is available for all file types on all OSs. It allows you to open the selected file in a seperate app:
The file will be opened in the OS's preffered app for the file (possibly VSCode), and if no app is selected, you will be promted to select one (if it's runnable or an app itself, it will launch):