Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running simple terminal commands in command palette VS Code

Is it possible to run simple terminal commands in Command Palette? Or an extension for it?

For example, something like rm unwantedfile.txt would be super useful to do in via command palette rather than having to open up the integrated terminal or do the task via mouse (mainly interested in not having to take my hands off the keyboard).

I know there's Edit with Shell Command, but it doesn't appear to be able to edit outside the file itself.

like image 947
James Wright Avatar asked Oct 16 '25 02:10

James Wright


1 Answers

You can either use VS Code built-in functionality using shortcuts. Just add to keybindings.json:

{
  "key": "cmd+shift+R",
  "command": "workbench.action.terminal.sendSequence",
  "args": {
    "text": "clear; rails server\u000D"
  }
},

Or you can take a look at this extension, Command Runner, that does exactly what you're looking for.

like image 183
Flavio Wuensche Avatar answered Oct 18 '25 17:10

Flavio Wuensche



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!