Terminal Command Keys
Assign terminal commands to a keybinding.
Open your keybindings.json (Command Palette => 'Preferences: Open Keyboard Shortcut File') and add an entries like these:
"cmd" : required
This is the command that will be passed to the terminal when it is opened. The following substitutions are available to be used:
Here are some examples:
If you need to run different commands for different file types, but wish to use the same keycombo, check out vscode's "when" clauses.
"newTerminal" : optional, default false
If true, the terminal is destroyed and a fresh terminal is created for each run. You cannot scroll up to review previous commands/results.
If false, re-uses the same terminal for each command run. You can scroll up to review previous commands/results.
"saveAllFiles" : optional, default true
If true, saves all files before running the command.
If false, does not save all files before running the command.
"showTerminal" : options, default true
If true, ensures that the terminal is showing when running the command.
If false, does not change the visibility of the terminal when running the command.
The differences (at this time):